Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

Issue Confirmations

  • Yes (1)No (0)
Photo

Map Crash: getlook(4)

Posted by Poison on 25 May 2014 - 06:20 PM

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

Thank you all for helping and reporting this issue, fixed in https://github.com/H...82ba8ae92f4d99d

pan 
changed severity to: 3 - Medium
changed status to: Fixed