summaryrefslogtreecommitdiff
path: root/src/char/int_guild.c
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-02 17:00:17 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-02 17:00:17 +0000
commit0e8da0a06a86128c2c2a9f663592e2a8e4980141 (patch)
tree8f7a77bef02219b4144efecb1d5ffd4c6e503f9e /src/char/int_guild.c
parent830f648e2f75671c835e3c382ef8d11c8e58565c (diff)
downloadhercules-0e8da0a06a86128c2c2a9f663592e2a8e4980141.tar.gz
hercules-0e8da0a06a86128c2c2a9f663592e2a8e4980141.tar.bz2
hercules-0e8da0a06a86128c2c2a9f663592e2a8e4980141.tar.xz
hercules-0e8da0a06a86128c2c2a9f663592e2a8e4980141.zip
Replaced some magic numbers related to castle guardians with `MAX_GUARDIANS`.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15650 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/int_guild.c')
-rw-r--r--src/char/int_guild.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index df91e4de4..3b41e375f 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -1836,16 +1836,9 @@ int mapif_parse_GuildCastleDataLoad(int fd,int castle_id,int index)
case 7: return mapif_guild_castle_dataload(gc.castle_id,index,gc.payTime); break;
case 8: return mapif_guild_castle_dataload(gc.castle_id,index,gc.createTime); break;
case 9: return mapif_guild_castle_dataload(gc.castle_id,index,gc.visibleC); break;
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- return mapif_guild_castle_dataload(gc.castle_id,index,gc.guardian[index-10].visible); break;
default:
+ if (index > 9 && index <= 9+MAX_GUARDIANS)
+ return mapif_guild_castle_dataload(gc.castle_id,index,gc.guardian[index-10].visible);
ShowError("mapif_parse_GuildCastleDataLoad ERROR!! (Not found index=%d)\n", index);
return 0;
}
@@ -1880,16 +1873,11 @@ int mapif_parse_GuildCastleDataSave(int fd,int castle_id,int index,int value)
case 7: gc.payTime = value; break;
case 8: gc.createTime = value; break;
case 9: gc.visibleC = value; break;
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- gc.guardian[index-10].visible = value; break;
default:
+ if (index > 9 && index <= 9+MAX_GUARDIANS) {
+ gc.guardian[index-10].visible = value;
+ break;
+ }
ShowError("mapif_parse_GuildCastleDataSave ERROR!! (Not found index=%d)\n", index);
return 0;
}