Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COF_BUILD: added donator fields in clientdata_t and usercmd_t structures #557

Merged
merged 2 commits into from
Nov 10, 2024

Conversation

SmileyAG
Copy link
Collaborator

@SmileyAG SmileyAG commented Nov 10, 2024

I don't have time to review previous requests, hope everything would be stable for me close to start of winter, but I pushed this request as a hotfix before the release.
I did it right now via the web interface instead of how I usually do it with Git CMD due to circumstances, I hope everything is OK with the commit history. DON'T EXPECT FROM ME REBASE OR SOMETHING RIGHT NOW.

If you want to know how to find these fields, I'll tell you:

  • Create a delta_definition_t struct or import delta.h header in hw.dll from CoF in Ghidra/IDA Pro
  • Find the DELTA_Init function, the code there will look like this:
void FUN_01d5224b(void)
{
  FUN_01d44eff(s_delta_stats_01eb399c,FUN_01d52208);
  FUN_01d44eff(s_delta_clear_01eb39a8,FUN_01d52135);
  FUN_01d51a7a(s_clientdata_t_01eb39b4,g_ClientDataDefinition,0x39);
  FUN_01d51a7a(s_weapon_data_t_01eb39c4,g_WeaponDataDefinition,0x16);
  FUN_01d51a7a(s_usercmd_t_01eb39d4,g_UsercmdDataDefinition,0x11);
  FUN_01d51a7a(s_entity_state_t_01eb39e0,g_EntityDataDefinition,0x57);
  FUN_01d51a7a(s_entity_state_player_t_01eb39f0,g_EntityDataDefinition,0x57);
  FUN_01d51a7a(s_custom_entity_state_t_01eb3a08,g_EntityDataDefinition,0x57);
  FUN_01d51a7a(s_event_t_01eb3a20,&PTR_s_entindex_01eb23b0,0xe);
  return;
  • I renamed the g_ variables myself, by default you won't have it.
  • But the point is that by default they will have a garbage data type for obvious reasons, but you should reassign them to delta_definition_t globalvariable[ARRAYSIZE]
  • You can take the ARRAYSIZE from the last argument of the function. For example, g_ClientDataDefinition has an array size of 0x39 (57)
  • Therefore, you assign delta_definition_t g_ClientDataDefinition[57].

After which you simply compare it with the data in the GoldSrc engine and make changes in your headers due to the corresponding fields.

@YaLTeR YaLTeR merged commit cbc496b into YaLTeR:master Nov 10, 2024
7 checks passed
@YaLTeR
Copy link
Owner

YaLTeR commented Nov 10, 2024

Thanks

@SmileyAG
Copy link
Collaborator Author

this is binary in case if someone want to verify: cof-engine-steam.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants