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

  • #007646

  • 0 - None Assigned

  • Fixed

Issue Confirmations

  • Yes (0)No (0)
Photo

bg mapflag + instance + reloadscript = mapserver crash

Posted by purityz on 11 August 2013 - 10:23 AM

if you're using reloadscript when they are a instance map that using battleground mapflag. mapserver will crash.

bat_c01 mapflag battleground 2
 
morocc,150,150,5    script    testtestsss    1002,{
set .@id,instance_create("bg instance",0,IOT_NONE);
instance_attachmap("bat_c01", .@id,1,"mymapname");
instance_init .@id;
warp "mymapname",0,0;
}

after clicking this npc, try to use @reloadscript then mapserver will crash.


also, I dont know if is this a bug.
I cannot creating IOT_NONE <OwnerType> instance without player attach to a script.
if I do mapserver will report "script_rid2sd: fatal error ! player not attached".



*****edit*****

if you do it this way
morocc,150,150,5    script    testtestsss    1002,{
set .@id,instance_create("bg instance",0,IOT_NONE);
instance_attachmap("bat_c01", .@id,1,"mymapname");
instance_init .@id;

//set mapflag here
setmapflag "mymapname",mf_battleground,2;

warp "mymapname",0,0;
}


it wont crash after @reloadscript

also if you use instance_attachmap like this

instance_attachmap("prontera", .@id,1,"mymapname");


after instance destroy or timeout. attached map are not remove, they're still in (maybe) MAPDB.

morocc,150,150,5    script	   testtestsss    1002,{
set .@id,instance_create("prontera instance",0,IOT_NONE);
instance_attachmap("prontera", .@id,1,"mymapname");

//remove instance
instance_detachmap "mymapname",.@id;
instance_destroy .@id;
}


using this script first time you click. it will create instance. attach prontera to that instance and named it "mymapname". In the end, remove them.
second times you click it will thow this error.

[Error]: instance_add_map: trying to create instanced map with existent name 'mymapname'
[Error]: buildin_instance_attachmap: instance creation failed (prontera): -2


Edited by purityz, 11 August 2013 - 03:31 PM.


could you please make a crash dump and post it here. it may help to fix the issue thanks! :)

this is a fix to problem that map are not being remove from mapdb after instance destroy.

in map.c
void map_removemapdb(struct map_data *m) {
    index2mapid[m->index] = -1;
}


to

void map_removemapdb(struct map_data *m) {
    index2mapid[m->index] = -1;
    if(strdb_iget(mapindex_db, m->name)){
    strdb_remove(mapindex_db, m->name);
    }
}


Ind 
changed status to: Confirmed
changed status to: Started

new information.

not only mapflag battleground that make server crash.
also mapflag gvg.

Ind 
changed status to: Fixed

Fixed in https://github.com/H...d2a2c5692e12115
Thank you for all the scenarios. I fixed all the bugs to the extent I could debug, also fixed the player attached error you reported (it was due to the IOT constants being missing in db/const.txt, server thought they were player variables and that was why the rid2sd error came up)