Corrected script command getmapxy (#3922)

* Fixed an issue with floating NPC being on an 'invalid' map and attempting to store the map name.
Thanks to @Atemo!
This commit is contained in:
Aleos 2019-02-06 12:34:13 -05:00 committed by GitHub
parent ad2eabb906
commit 5908c0484f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15033,7 +15033,10 @@ BUILDIN_FUNC(getmapxy)
x= bl->x;
y= bl->y;
safestrncpy(mapname, map_getmapdata(bl->m)->name, MAP_NAME_LENGTH);
if (bl->m >= 0)
safestrncpy(mapname, map_getmapdata(bl->m)->name, MAP_NAME_LENGTH);
else
memset(mapname, '\0', sizeof(mapname));
//Set MapName$
num=st->stack->stack_data[st->start+2].u.num;