summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-10-19 17:45:35 +0200
committerGitHub <noreply@github.com>2019-10-19 17:45:35 +0200
commitddd0e461fb8e451912a6aee90869023e2c2d8272 (patch)
tree4dc1d7ab1c36534420636ee0769b7650fcbe2272 /src/map
parent574e63d3e04e6b1cdb2d9d19fa164263ba5d5bf7 (diff)
parentf174b0c7067be290a00882e09746d8a51d46f9c0 (diff)
downloadhercules-ddd0e461fb8e451912a6aee90869023e2c2d8272.tar.gz
hercules-ddd0e461fb8e451912a6aee90869023e2c2d8272.tar.bz2
hercules-ddd0e461fb8e451912a6aee90869023e2c2d8272.tar.xz
hercules-ddd0e461fb8e451912a6aee90869023e2c2d8272.zip
Merge pull request #2563 from MishimaHaruna/cpcmds-fixes
Console command fixes
Diffstat (limited to 'src/map')
-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));