summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-08-25 19:50:13 +0200
committerHaru <haru@dotalux.com>2019-10-18 18:14:23 +0200
commit2f27b0ae1528bc37a18d8137ec26bb782e5c38a4 (patch)
treea57c19443bec50ddafe2fb22eb8eef4a6a851a07 /src/map/map.c
parent1f6eebe5421534c0d2a29e793ae8ce0328913c7c (diff)
downloadhercules-2f27b0ae1528bc37a18d8137ec26bb782e5c38a4.tar.gz
hercules-2f27b0ae1528bc37a18d8137ec26bb782e5c38a4.tar.bz2
hercules-2f27b0ae1528bc37a18d8137ec26bb782e5c38a4.tar.xz
hercules-2f27b0ae1528bc37a18d8137ec26bb782e5c38a4.zip
Fix a missing mapindex update in the gm:info console command
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/map.c b/src/map/map.c
index f3fc9d46b..957098dd4 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -45,7 +45,6 @@
#include "map/mapreg.h"
#include "map/mercenary.h"
#include "map/mob.h"
-#include "map/npc.h"
#include "map/npc.h" // npc_setcells(), npc_unsetcells()
#include "map/party.h"
#include "map/path.h"
@@ -6305,6 +6304,7 @@ static CPCMD(gm_position)
map->cpsd->bl.x = x;
map->cpsd->bl.y = y;
map->cpsd->bl.m = m;
+ map->cpsd->mapindex = map_id2index(m);
}
static CPCMD(gm_use)
{
@@ -6333,6 +6333,8 @@ static void map_cp_defaults(void)
map->cpsd->bl.x = mapindex->default_x;
map->cpsd->bl.y = mapindex->default_y;
map->cpsd->bl.m = map->mapname2mapid(mapindex->default_map);
+ Assert_retv(map->cpsd->bl.m >= 0);
+ map->cpsd->mapindex = map_id2index(map->cpsd->bl.m);
console->input->addCommand("gm:info",CPCMD_A(gm_position));
console->input->addCommand("gm:use",CPCMD_A(gm_use));