amxmodx icon indicating copy to clipboard operation
amxmodx copied to clipboard

gamerules gamedata for ReGameDLL_CS imcompatible?

Open SmileYzn opened this issue 5 years ago • 7 comments

Help us help you

  • [x] I have checked that my issue doesn't exist yet.
  • [x] I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
  • [x] I can always reproduce the issue with the provided description below.

Environment

  • Operating System version: Windows 8.1
  • Game/AppID (with version if applicable): CS 1.6 (appId 10 i guess)
  • Current AMX Mod X version: 1.10
  • Current Metamod version: 1.21
  • [ ] I have updated AMX Mod X to the latest version and it still happens.
  • [x] I have updated AMX Mod X to the latest snapshot and it still happens.
  • [x] I have updated Metamod to the latest version and it still happens.

Description

Im trying to reset freezetime or round time on the fly, in original HLDS the code works fine. m_fRoundCount do not exists or is not correct for ReGameDLL_CS. Sorry for being a noob, but is not the case to add or update current gamedata for regamedll_cs?

Problematic Code (or Steps to Reproduce)

stock SetRoundTime(iTime)
{
  static iMsgRoundTime;
  
  if(iMsgRoundTime || (iMsgRoundTime = get_user_msgid("RoundTime")))
  {
      set_gamerules_int("CHalfLifeMultiplay","m_iRoundTimeSecs",iTime);
      set_gamerules_float("CHalfLifeMultiplay","m_fRoundCount",get_gametime());

      message_begin(MSG_ALL,iMsgRoundTime);
      write_short(iTime);
      message_end();
  }
}  

The main problem is that m_fRoundCount offsets do not exist on ReGameDLL_CS. So when i use this code works fine on original but not on ReGameDLL_CS (The roundtimer goes crazy and players are respawned again).

Any idea if this is a real "BUG" or not?

SmileYzn avatar Jan 09 '20 13:01 SmileYzn

Not a bug, ReGameDLL_CS has custom gamerules data. https://github.com/s1lentq/ReGameDLL_CS/blob/27b2a8c8c950540a2dd9fde32da6f7f13e842eaa/regamedll/dlls/gamerules.h#L335-L337 You have to use reapi to manipulate gamerules because of that.

etojuice avatar Jan 11 '20 11:01 etojuice

So, there is the question. I know that amxmodx supports ReGameDLL_CS, but why not implement these offsets on current game data to?

SmileYzn avatar Jan 11 '20 14:01 SmileYzn

So, there is the question. I know that amxmodx supports ReGameDLL_CS, but why not implement these offsets on current game data to?

because you can use reapi, there's no point to duplicate it

voed avatar Jan 11 '20 14:01 voed

So, there is the question. I know that amxmodx supports ReGameDLL_CS, but why not implement these offsets on current game data to?

I'm not sure. I think it's because game name is the same (cstrike)

etojuice avatar Jan 11 '20 15:01 etojuice

So, there is the question. I know that amxmodx supports ReGameDLL_CS, but why not implement these offsets on current game data to?

I'm not sure. I think it's because game name is the same (cstrike)

what?

As voed said, you can use reapi

xLeviNx avatar Jan 11 '20 20:01 xLeviNx

Soo i basically can't use gamedata from fakemeta in rehlds? A bit strange to me. Since plugins need to maintain compatibility with these two servers to be approved in amxx forums.

Let's see what other users think :happy:

SmileYzn avatar Jan 11 '20 21:01 SmileYzn

@SmileYzn https://github.com/s1lentq/ReGameDLL_CS/blob/eb91f9280d34deb47e54ee7d28d69de30ee31339/regamedll/dlls/gamerules.h#L701

WaLkZa avatar Apr 21 '23 20:04 WaLkZa