Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Yandex

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » <help>Keeping assigned zone
Forum Rules | Mark all | Recent Posts

<help>Keeping assigned zone
< Newer Topic :: Older Topic > How to keep when still a mortal.

Pages:<< prev 1 next >>
* #1 Mar 29, 2005, 10:09 pm
Go to the top of the page
Go to the bottom of the page

Txzeenath
Apprentice
GroupMembers
Posts86
JoinedJul 24, 2004

Usually I can figure this type of thing out.. but I cannot find where it would cause my problem..

I'm using a heavily modified smaug codebase.


I currently coded my own "avator" function that I call mortality, which allows immortals turn to a level 50 mortal state at will, and back.. what I am having trouble with is that when mortality is used, than quit.. when you come back your assigned area is no longer assigned.. yet in the pfile the vnums are still written(I modified the saving to still save bamfin/bamfout and vnums while using mortality).. so have no idea why the area itself no longer is assigned.


So basically.. my problem is that I can't find where it would remove an assigned area from a person when they quit, than come back on.
       
Post is unread #2 Mar 30, 2005, 5:20 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Chances are what happened is the person logged back on and their level was set to the lower one instead of their natural one. You probably need to add some kind of check to be sure that is taken into account.

      if( IS_IMMORTAL( ch ) )
      {
         if( ch->pcdata->wizinvis < 2 )
            ch->pcdata->wizinvis = ch->level;
         assign_area( ch );
      }


The above code from load_char_obj in save.c is probably a good spot for it. Notice it's checking to see if they're immortal before assigning their area. If your avator function sets their level to 50, this is likely your problem.
       
Post is unread #3 Mar 30, 2005, 8:10 am
Go to the top of the page
Go to the bottom of the page

Txzeenath
Apprentice
GroupMembers
Posts86
JoinedJul 24, 2004

I have their immortal level stored in another spot, immlevel, so i'll just do


if (is_IMMORTAL(ch) || ch->immlevel > 0)




The immlevel is reduced to 0 when they are back as immortal form.. and all mortals of course have 0.. so anything greater than 0 would signify immortality.


Tnx for help :) i'll try it
       
Post is unread #4 Mar 30, 2005, 8:44 am
Go to the top of the page
Go to the bottom of the page

Txzeenath
Apprentice
GroupMembers
Posts86
JoinedJul 24, 2004

Hmm no luck on that.. I had that set already :mad:


if (IS_IMMORTAL(ch) || ch->immlevel >= LEVEL_IMMORTAL)
{
if (ch->pcdata->wizinvis < 2)
ch->pcdata->wizinvis = ch->level;
assign_area(ch);
}
       
Post is unread #5 Apr 3, 2005, 11:30 am
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Look to where the data is saved... in save.c - make sure you have a check so it doesn't skip over Imm-Only data when the Imm-As-Player is saved.
       
Post is unread #6 Apr 3, 2005, 12:53 pm
Go to the top of the page
Go to the bottom of the page

Txzeenath
Apprentice
GroupMembers
Posts86
JoinedJul 24, 2004

It's nothing that being saved in the pfile, cuz it still has the ranges saved, both in the pfile and in the gods directory.

Which is where my problem comes... it has the ranges... but no assigned area :mad:
       
Post is unread #7 Apr 3, 2005, 1:21 pm
Go to the top of the page
Go to the bottom of the page

Txzeenath
Apprentice
GroupMembers
Posts86
JoinedJul 24, 2004

Found the problem.. it's within the assign_area command itself.



if (get_trust(ch) > LEVEL_IMMORTAL
&& ch->pcdata->r_range_lo && ch->pcdata->r_range_hi)



change to:

if ((get_trust(ch) > LEVEL_IMMORTAL || ch->immlevel > 0)
&& ch->pcdata->r_range_lo && ch->pcdata->r_range_hi)



Tada... it works
       
Pages:<< prev 1 next >>