From 0e8da0a06a86128c2c2a9f663592e2a8e4980141 Mon Sep 17 00:00:00 2001 From: gepard1984 Date: Fri, 2 Mar 2012 17:00:17 +0000 Subject: 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 --- src/map/guild.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'src/map/guild.c') 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; } -- cgit v1.2.3-70-g09d2