1.1 --- a/plugins/include/entity_prop_stocks.inc Thu Mar 24 09:48:36 2011 -0400
1.2 +++ b/plugins/include/entity_prop_stocks.inc Mon Apr 04 13:37:29 2011 -0400
1.3 @@ -123,7 +123,8 @@
1.4 #define IN_GRENADE1 (1 << 23) // grenade 1
1.5 #define IN_GRENADE2 (1 << 24) // grenade 2
1.6
1.7 -// CBaseEntity::m_fFlags
1.8 +// Note: these are only for use with GetEntityFlags and SetEntityFlags
1.9 +// and may not match the game's actual, internal m_fFlags values.
1.10 // PLAYER SPECIFIC FLAGS FIRST BECAUSE WE USE ONLY A FEW BITS OF NETWORK PRECISION
1.11 #define FL_ONGROUND (1 << 0) // At rest / on the ground
1.12 #define FL_DUCKING (1 << 1) // Player flag -- Player is fully crouched
1.13 @@ -159,36 +160,36 @@
1.14 #define FL_DISSOLVING (1 << 28) // We're dissolving!
1.15 #define FL_TRANSRAGDOLL (1 << 29) // In the process of turning into a client side ragdoll.
1.16 #define FL_UNBLOCKABLE_BY_PLAYER (1 << 30) // pusher that can't be blocked by the player
1.17 -// END m_fFlags #defines
1.18 +#define FL_FREEZING (1 << 31) // We're becoming frozen!
1.19 +#define FL_EP2V_UNKNOWN1 (1 << 31) // Unknown
1.20 +// END entity flag #defines
1.21
1.22 /**
1.23 * Get an entity's flags.
1.24 *
1.25 + * @note The game's actual flags are internally translated by SM
1.26 + * to match the entity flags defined above as the actual values
1.27 + * can differ per engine.
1.28 + *
1.29 * @param entity Entity index.
1.30 - * @return Entity's flags, see m_fFlag defines above
1.31 + * @return Entity's flags, see entity flag defines above.
1.32 * @error Invalid entity index, or lack of mod compliance.
1.33 */
1.34 -stock GetEntityFlags(entity)
1.35 -{
1.36 - static bool:gotconfig = false;
1.37 - static String:datamap[32];
1.38 -
1.39 - if (!gotconfig)
1.40 - {
1.41 - new Handle:gc = LoadGameConfigFile("core.games");
1.42 - new bool:exists = GameConfGetKeyValue(gc, "m_fFlags", datamap, sizeof(datamap));
1.43 - CloseHandle(gc);
1.44 -
1.45 - if (!exists)
1.46 - {
1.47 - strcopy(datamap, sizeof(datamap), "m_fFlags");
1.48 - }
1.49 -
1.50 - gotconfig = true;
1.51 - }
1.52 -
1.53 - return GetEntProp(entity, Prop_Data, datamap);
1.54 -}
1.55 +native GetEntityFlags(entity);
1.56 +
1.57 +/**
1.58 + * Sets an entity's flags.
1.59 + *
1.60 + * @note The entity flags as defined above are internally translated by SM
1.61 + * to match the current game's expected value for the flags as
1.62 + * the actual values can differ per engine.
1.63 + *
1.64 + * @param entity Entity index.
1.65 + * @param flags Entity flags, see entity flag defines above.
1.66 + * @noreturn
1.67 + * @error Invalid entity index, or lack of mod compliance.
1.68 + */
1.69 +native SetEntityFlags(entity, flags);
1.70
1.71
1.72 /**