diff --git a/src/common/mapindex.c b/src/common/mapindex.c index 112ddb6246..4f8540e87b 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -120,7 +120,7 @@ unsigned short mapindex_name2idx(const char* name, const char *func) { } const char* mapindex_idx2name(unsigned short id, const char *func) { - if (id > MAX_MAPINDEX || !mapindex_exists(id)) { + if (id >= MAX_MAPINDEX || !mapindex_exists(id)) { ShowDebug("(%s) mapindex_id2name: Requested name for non-existant map index [%d] in cache.\n", func, id); return indexes[0].name; // dummy empty string so that the callee doesn't crash } diff --git a/src/map/script.c b/src/map/script.c index 9bd8c08ced..7a96ee3d22 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -17656,7 +17656,7 @@ BUILDIN_FUNC(unitskillusepos) if (bl != NULL) { if (bl->type == BL_NPC) { if (!((TBL_NPC*)bl)->status.hp) - status_calc_npc(((TBL_NPC*)bl), SCO_FORCE); + status_calc_npc(((TBL_NPC*)bl), SCO_FIRST); else status_calc_npc(((TBL_NPC*)bl), SCO_NONE); }