From fafa762fab2ca43ff4977eb7b68375afee3da4d8 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Mon, 12 Jan 2009 15:27:25 +0000 Subject: [PATCH] fix compiler warning git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4130 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entity.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/src/entity.h b/source/src/entity.h index 82af654d..ee9f0098 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -14,7 +14,7 @@ enum // static entity types MAXENTTYPES }; -#define isitem(i) (i >= I_CLIPS && i <= I_AKIMBO) +#define isitem(i) ((i) >= I_CLIPS && (i) <= I_AKIMBO) struct persistent_entity // map entity { @@ -32,7 +32,11 @@ struct entity : public persistent_entity entity(short x, short y, short z, uchar type, short attr1, uchar attr2, uchar attr3, uchar attr4) : persistent_entity(x, y, z, type, attr1, attr2, attr3, attr4), spawned(false) {} entity() {} bool fitsmode(int gamemode) { return !m_noitems && isitem(type) && !(m_noitemsnade && type!=I_GRENADE) && !(m_pistol && type==I_AMMO); } - void transformtype(int gamemode) { type = (m_noitemsnade && type==I_CLIPS) ? I_GRENADE : ((m_pistol && type==I_AMMO) ? I_CLIPS : type); } + void transformtype(int gamemode) + { + if(m_noitemsnade && type==I_CLIPS) type = I_GRENADE; + else if(m_pistol && type==I_AMMO) type = I_CLIPS; + } }; struct itemstat { int add, start, max, sound; };