From 8ea62d22cbee15e09be25216b03021ad19bbd735 Mon Sep 17 00:00:00 2001 From: 9iky6 Date: Sun, 5 Oct 2014 16:19:47 +0600 Subject: [PATCH] Update engine_stocks.inc When compiling was varningov , and the function itself was crooked written --- plugins/include/engine_stocks.inc | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/plugins/include/engine_stocks.inc b/plugins/include/engine_stocks.inc index 638905e8..1ef21890 100755 --- a/plugins/include/engine_stocks.inc +++ b/plugins/include/engine_stocks.inc @@ -159,32 +159,19 @@ stock set_rendering(index, fx=kRenderFxNone, r=255, g=255, b=255, render=kRender /* Set flags on an entity */ stock set_entity_flags(ent,flag,onoff) { - if ((entity_get_int(ent,EV_INT_flags)&flag) > 0) + new iFlags = entity_get_int(ent, EV_INT_flags); + if(iFlags & flag) { - if (onoff == 1) - { - return 2; - } - else - { - entity_set_int(ent,EV_INT_flags,entity_get_int(ent,EV_INT_flags)-flag); - return 1; - } + if(onoff == 1) return 2; + iFlags &= ~flag; } else { - if (onoff == 0) - { - return 2; - } - else - { - entity_set_int(ent,EV_INT_flags,entity_get_int(ent,EV_INT_flags)+flag); - return 1; - } + if(onoff == 0) return 2; + iFlags |= flag; } - - return 0; + entity_set_int(ent, EV_INT_flags, iFlags); + return 1; } /* If visible = 1, entity will be set to be visible, else invisible. */