Hi, in the net_props and data_maps dumps, the type of the member "m_iClip1" is
4Bytes 1-Byte,
yet when using a value above 255 (the max value that a boolean variable can represent) it seems to overflow off course it will overflow
Here's a small snippet to demonstrate the issue:
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sdkhooks>
public void OnEntityCreated(int entity, const char[] classname) {
if ( strcmp(classname, "weapon_rifle_m60") == 0 )
SDKHook(entity, SDKHook_SpawnPost, OnSpawnPost);
}
void OnSpawnPost(int entity) {
if( !IsValidEntity(entity) )
return;
RequestFrame(OnNextFrame, EntIndexToEntRef(entity));
}
void OnNextFrame(int entity) {
if( (entity = EntRefToEntIndex(entity)) != INVALID_ENT_REFERENCE ) {
SetEntProp(entity, Prop_Send, "m_iClip1", 300); // this will overflow
static char classname[32];
GetEdictClassname(entity, classname, sizeof(classname));
int clipsize = GetEntProp(entity, Prop_Send, "m_iClip1");
PrintToChatAll("Spawned: %s | index: %d", classname, entity);
PrintToChatAll("with clip size %d", clipsize);
}
}
Using
Mission and Weapons - Info Editor to increase the "clip_size" value of "weapon_rifle_m60" has the same effect
A possible solution is to do something similar to
this
Edit: on Windows the "m_iClip1" net_prop is 1-Byte long, whereas on Linux it's 4-Bytes (32-Bits), Rooky mistake
Still unsolved though