summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-18 13:38:26 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-18 13:38:26 +0000
commit8192b22f355b8e0bce5a49bf0ddaeaf754f1682d (patch)
treedb52cbf0686111be6a110aa4a2018560ab4e410a /src/map
parent890239c175ed319f0ed7b0b77fdce833426db698 (diff)
downloadhercules-8192b22f355b8e0bce5a49bf0ddaeaf754f1682d.tar.gz
hercules-8192b22f355b8e0bce5a49bf0ddaeaf754f1682d.tar.bz2
hercules-8192b22f355b8e0bce5a49bf0ddaeaf754f1682d.tar.xz
hercules-8192b22f355b8e0bce5a49bf0ddaeaf754f1682d.zip
Fixed a crash when a castle from [0..MAX-1] wasn't in the db
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9668 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/guild.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index b71b6344b..b75af5bea 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -1908,18 +1908,18 @@ int guild_agit_break(struct mob_data *md)
return 0;
}
-// [MouseJstr]
-// How many castles does this guild have?
-int guild_checkcastles(struct guild *g) {
- int i,nb_cas=0, id,cas_id=0;
- struct guild_castle *gc;
- id=g->guild_id;
- for(i=0;i<MAX_GUILDCASTLE;i++){
- gc=guild_castle_search(i);
- cas_id=gc->guild_id;
- if(g->guild_id==cas_id)
- nb_cas=nb_cas+1;
- } //end for
+// How many castles does this guild have?
+int guild_checkcastles(struct guild *g)
+{
+ int i, nb_cas = 0;
+ struct guild_castle* gc;
+
+ for(i = 0; i < MAX_GUILDCASTLE; i++) {
+ gc = guild_castle_search(i);
+ if(gc && gc->guild_id == g->guild_id)
+ nb_cas++;
+ }
+
return nb_cas;
}