"Couldn't find offset for m_flNextUse!!!" error when starting half-life 1 Created 1 year ago2022-05-31 20:07:01 UTC by petergriffinxxxtentacion petergriffinxxxtentacion

Created 1 year ago2022-05-31 20:07:01 UTC by petergriffinxxxtentacion petergriffinxxxtentacion

Posted 1 year ago2022-05-31 20:07:01 UTC Post #346583
So, i'm trying to make a new float value in weaponinfo.h so i can add a delay in my code, when i first added m_flNextUse (which is just a new m_flNextPrimaryAttack but for the use key) the game just kept crashing once i equipped any weapon for a small amount of time, visual studio didn't give any warnings or errors. After a bit of researching and debugging, i tried to add m_flNextUse in delta.lst, hoping for the crash to be over, but now when i launch my half life mod, i stumble into another error:

Fatal error; Couldn't find offset for m_flNextUse!!!

After i click ok, the game just closes and visual studio doesn't give any warnings once again. Anyone knows how to fix this error?
Posted 1 year ago2022-06-01 08:01:40 UTC Post #346586
You can't modify any data structure that's shared with the engine. weapon_data_t is one of those, along with every other structure referenced in delta.lst and others.

If you need to send data to the client you need to use the existing variables. If you run out then you'll need to send data using user messages. If that's not a solution for your problem then there's nothing more you can do.

Also note that data in weapon_data_t is only sent to clients if weapon prediction is enabled. Given that you're trying to send data related to the use key i don't think sending it as part of weapon data is the correct solution. The server is responsible for processing use inputs anyway, so it may not even be necessary to send this data to the client.
You must be logged in to post a response.