Permalink
Browse files

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!
  • Loading branch information...
aleos89 committed Feb 6, 2019
1 parent ad2eabb commit 5908c0484fc3243575afbfc8f231d01f64837052
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/map/script.cpp
@@ -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;

0 comments on commit 5908c04

Please sign in to comment.