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

Fix cstrike ext gamedata for css 64bit #2287 #2289

Merged
merged 5 commits into from
Mar 2, 2025

Conversation

ambaca
Copy link
Contributor

@ambaca ambaca commented Mar 1, 2025

Looked signatures for cs:s 64bit windows, made little change in gamedata file structure as well.

Maybe fix issue #2287

sorry for github hassle

ambaca added 3 commits March 1, 2025 16:10
I looked signatures for cs:s 64bit windows. Made some other change in file as well.

Maybe fix issue alliedmodders#2287
Fix cstrike ext gamedata for css 64bit alliedmodders#2287
@ambaca
Copy link
Contributor Author

ambaca commented Mar 1, 2025

dam... I need recheck AliasToWeaponID and WeaponIDToAlias :(

*edit
Seems on last update #2280, those two signatures went across. This will fix that.

@etkaar
Copy link

etkaar commented Mar 1, 2025

Thank you!

@ambaca
Copy link
Contributor Author

ambaca commented Mar 1, 2025

Seems Windows 64bit "WeaponPrice" offset is wrong (CS_GetWeaponPrice) gives random prices
Found right offsets. Added also linux64 signatures and offsets

@Kenzzer
Copy link
Member

Kenzzer commented Mar 2, 2025

PR looks great! But I'm still doubtful of SetModelFromClass signatures, are you sure the function exists on windows ? Have you tested the associated native and see if it worked ?

@noillt
Copy link

noillt commented Mar 2, 2025

I can confirm that this pull request has resolved these issues on 64-bit counter-strike:source server running 1.13.0.7218 sourcemod

cstrike/addons/sourcemod/logs/errors_20250302.log
22:L 03/02/2025 - 01:05:23: [SM]   [0] CS_SetClientClanTag
29:L 03/02/2025 - 01:05:48: [SM]   [0] CS_SetMVPCount
43:L 03/02/2025 - 01:05:48: [SM]   [0] CS_GetClientClanTag
49:L 03/02/2025 - 01:05:49: [SM]   [0] CS_RespawnPlayer
55:L 03/02/2025 - 01:05:49: [SM]   [0] CS_GetClientClanTag

@Sidicer
Copy link

Sidicer commented Mar 2, 2025

I've tested CS_UpdateClientModel on Windows 32-bit Server and both 1.13 - build 7215 game.css.txt and from this PR cause the same stack trace

L 03/02/2025 - 01:37:33: [SM] Exception reported: Failed to lookup SetModelFromClass signature.
L 03/02/2025 - 01:37:33: [SM] Blaming: testmodel.smx
L 03/02/2025 - 01:37:33: [SM] Call stack trace:
L 03/02/2025 - 01:37:33: [SM]   [0] CS_UpdateClientModel
L 03/02/2025 - 01:37:33: [SM]   [1] Line 48, testmodel.sp::Command_UpdateClientModel
#include <sdktools>
public Action Command_Model(int client, int args)
  SetEntityModel(client, modelPath);
}
public Action Command_UpdateClientModel(int client, int args)
  CS_UpdateClientModel(client);

@ambaca
Copy link
Contributor Author

ambaca commented Mar 2, 2025

PR looks great! But I'm still doubtful of SetModelFromClass signatures, are you sure the function exists on windows ? Have you tested the associated native and see if it worked ?

@Kenzzer

Video
https://www.youtube.com/watch?v=yfWtr_TZo_k

View from CSSPlayer::Spawn() [Windows srcds.exe]
image

@ambaca
Copy link
Contributor Author

ambaca commented Mar 2, 2025

I've tested CS_UpdateClientModel on Windows 32-bit Server and both 1.13 - build 7215 game.css.txt and from this PR cause the same stack trace

L 03/02/2025 - 01:37:33: [SM] Exception reported: Failed to lookup SetModelFromClass signature.
L 03/02/2025 - 01:37:33: [SM] Blaming: testmodel.smx
L 03/02/2025 - 01:37:33: [SM] Call stack trace:
L 03/02/2025 - 01:37:33: [SM]   [0] CS_UpdateClientModel
L 03/02/2025 - 01:37:33: [SM]   [1] Line 48, testmodel.sp::Command_UpdateClientModel
#include <sdktools>
public Action Command_Model(int client, int args)
  SetEntityModel(client, modelPath);
}
public Action Command_UpdateClientModel(int client, int args)
  CS_UpdateClientModel(client);
  • create folder called "custom" = addons\sourcemod\gamedata\sm-cstrike.games\custom\
  • place modified/edited game.css.txt in custom folder, reboot server.

SetModelFromClass exist in Counter-Strike mods only. And it will affect when player m_iClass is 0 or opposite team class index.

So, you would like use CS_UpdateClientModel() after https://sm.alliedmods.net/new-api/cstrike/CS_SwitchTeam

@Kenzzer
Copy link
Member

Kenzzer commented Mar 2, 2025

Perfect then, thanks for the video. Also could you add a comment to the gamedata on how to locate this function for future's sake. After that I'm ready to merge this in!

@ambaca
Copy link
Contributor Author

ambaca commented Mar 2, 2025

Perfect then, thanks for the video. Also could you add a comment to the gamedata on how to locate this function for future's sake. After that I'm ready to merge this in!

@Kenzzer 🔢

Copy link
Member

@Kenzzer Kenzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks for your work!

@Kenzzer Kenzzer merged commit 7fc48b8 into alliedmodders:master Mar 2, 2025
4 checks passed
psychonic pushed a commit that referenced this pull request Mar 2, 2025
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.

5 participants