summaryrefslogtreecommitdiff
path: root/src/map/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/map/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/map/guild.c')
-rw-r--r--src/map/guild.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 21a606394..ef19e2f8a 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -1731,16 +1731,11 @@ int guild_castledataloadack(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("guild_castledataloadack ERROR!! (Not found castle_id=%d index=%d)\n", castle_id, index);
return 0;
}
@@ -1801,16 +1796,11 @@ int guild_castledatasaveack(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("guild_castledatasaveack ERROR!! (Not found index=%d)\n", index);
return 0;
}