Issue information

Issue ID
#8216
Status
Fixed
Severity
Medium
Started
Poison
May 25, 2014 18:20
Last Post
pan
Jul 6, 2014 21:39
Confirmation
Yes (1)
No (0)

Poison - May 25, 2014 18:20

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)

Dastgir - May 26, 2014 8:53

[code=auto:0] [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! [/code]
Confirmed..
Maybe this can be fix:[code=auto:0] 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; } [/code]

This post has been edited by Dastgir on May 26, 2014 8:55

Haru - May 28, 2014 10:52

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...)

pan - Jul 6, 2014 21:38

Thank you all for helping and reporting this issue, fixed in [url="https://github.com/HerculesWS/Hercules/commit/79a6bf00d6e91ecdf157b904d82ba8ae92f4d99d"]https://github.com/HerculesWS/Hercules/commit/79a6bf00d6e91ecdf157b904d82ba8ae92f4d99d[/url]