summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-06-11 22:14:50 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-06-11 22:14:50 +0000
commitf24a3d43c43fc28c292cd7af10defae894aedc6d (patch)
tree3bdc85ce1e475a38440d155567587ee2ba59cfc0 /src/map/status.c
parent15d0d129834b212fa00285afa412cbb38f97ca6b (diff)
downloadhercules-f24a3d43c43fc28c292cd7af10defae894aedc6d.tar.gz
hercules-f24a3d43c43fc28c292cd7af10defae894aedc6d.tar.bz2
hercules-f24a3d43c43fc28c292cd7af10defae894aedc6d.tar.xz
hercules-f24a3d43c43fc28c292cd7af10defae894aedc6d.zip
- Fixed pet equip not displaying correctly at all (closes topic:153753)
- Removed old fixpos packet (the 'new' one is way smaller) - Fixed some major logical typos in the code, cleaned up many places git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10746 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 2b3d91dd4..9b4e2cfd2 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -4151,6 +4151,41 @@ int status_get_guild_id(struct block_list *bl)
return 0;
}
+int status_get_emblem_id(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ switch (bl->type) {
+ case BL_PC:
+ return ((TBL_PC*)bl)->guild_emblem_id;
+ case BL_PET:
+ if (((TBL_PET*)bl)->msd)
+ return ((TBL_PET*)bl)->msd->guild_emblem_id;
+ break;
+ case BL_MOB:
+ {
+ struct map_session_data *msd;
+ struct mob_data *md = (struct mob_data *)bl;
+ if (md->guardian_data) //Guardian's guild [Skotlex]
+ return md->guardian_data->emblem_id;
+ if (md->special_state.ai && (msd = map_id2sd(md->master_id)) != NULL)
+ return msd->guild_emblem_id; //Alchemist's mobs [Skotlex]
+ }
+ break;
+ case BL_HOM:
+ if (((TBL_HOM*)bl)->master)
+ return ((TBL_HOM*)bl)->master->guild_emblem_id;
+ break;
+ case BL_NPC:
+ if (bl->subtype == SCRIPT && ((TBL_NPC*)bl)->u.scr.guild_id > 0) {
+ struct guild *g = guild_search(((TBL_NPC*)bl)->u.scr.guild_id);
+ if (g)
+ return g->emblem_id;
+ }
+ break;
+ }
+ return 0;
+}
+
int status_get_mexp(struct block_list *bl)
{
nullpo_retr(0, bl);