summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/map.c10
-rw-r--r--src/map/script.c2
-rw-r--r--src/map/vending.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 448648f28..bd12e418b 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1838,18 +1838,18 @@ int map_addnpc(int m,struct npc_data *nd)
if( m < 0 || m >= map_num )
return -1;
- ARR_FIND( 0, MAX_NPC_PER_MAP, i, map[m].npc[i] == NULL );
+ ARR_FIND( 0, map[m].npc_num, i, map[m].npc[i] == NULL );
if( i == MAX_NPC_PER_MAP )
{
ShowWarning("too many NPCs in one map %s\n",map[m].name);
return -1;
}
+ nullpo_retr(0, nd);
+
if( i == map[m].npc_num )
map[m].npc_num++;
- nullpo_retr(0, nd);
-
map[m].npc[i]=nd;
nd->n = i;
idb_put(id_db,nd->bl.id,nd);
@@ -2317,8 +2317,8 @@ int map_eraseipport(unsigned short mapindex, uint32 ip, uint16 port)
}
/*==========================================
-* Map cache reading
-*===========================================*/
+ * Map cache reading
+ *==========================================*/
int map_readfromcache(struct map_data *m, FILE *fp)
{
struct map_cache_main_header header;
diff --git a/src/map/script.c b/src/map/script.c
index 0b4435351..8e0125cf1 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -8236,7 +8236,7 @@ BUILDIN_FUNC(sc_end)
bl = map_id2bl(potion_target);
}
- if( !bl ) return 0l;
+ if( !bl ) return 0;
if( type >= 0 && type < SC_MAX )
{
diff --git a/src/map/vending.c b/src/map/vending.c
index dd0f7ad76..098bfa28f 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -237,7 +237,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool
clif_skill_fail(sd, MC_VENDING, 0, 0);
return;
}
-
+
// check number of items in shop
if( count < 1 || count > MAX_VENDING || count > 2 + vending_skill_lvl )
{ // invalid item count