Issue Information
-
#008216
-
3 - Medium
-
Fixed
Issue Confirmations
-
Yes (1)No (0)
Map crash when you are checking getlook(4) every second and then logout suddenly.
[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: getlook (1 parameter):
[Debug]: Data: number value=4
[Debug]: Source (NPC): placeholder (invisible/not on a map)
[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: getlook (1 parameter):
[Debug]: Data: number value=4
[Debug]: Source (NPC): placeholder (invisible/not on a map)
[Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: getlook (1 parameter): [Debug]: Data: number value=4 [Debug]: Source (NPC): GetLookCheck at prontera (150,150) [Error]: Server received crash signal! Attempting to save all online characters!Confirmed..
Maybe this can be fix:
BUILDIN(getlook) { int type,val; TBL_PC *sd; sd=script->rid2sd(st); + if (sd==NULL){ + script_pushint(st,-1); + return false; + } type=script_getnum(st,2); val = -1; switch(type) { case LOOK_HAIR: val = sd->status.hair; break; //1 case LOOK_WEAPON: val = sd->status.weapon; break; //2 case LOOK_HEAD_BOTTOM: val = sd->status.head_bottom; break; //3 case LOOK_HEAD_TOP: val = sd->status.head_top; break; //4 case LOOK_HEAD_MID: val = sd->status.head_mid; break; //5 case LOOK_HAIR_COLOR: val = sd->status.hair_color; break; //6 case LOOK_CLOTHES_COLOR: val = sd->status.clothes_color; break; //7 case LOOK_SHIELD: val = sd->status.shield; break; //8 case LOOK_SHOES: break; //9 case LOOK_ROBE: val = sd->status.robe; break; //12 } script_pushint(st,val); return true; }
Hmm, why is the script still running if the player disconnects? Can you post an example of such a script?
Also, the fix might go into rid2sd perhaps (since it says fatal error, it should at least abort the running script, one would think...)
Also, the fix might go into rid2sd perhaps (since it says fatal error, it should at least abort the running script, one would think...)