Skip to content

Commit df38359

Browse files
committed
Fixed CS:GO data for Linux
1 parent c9c5fc0 commit df38359

File tree

4 files changed

+30
-23
lines changed

4 files changed

+30
-23
lines changed

addons/source-python/data/source-python/entities/csgo/CBaseCombatWeapon.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ srv_check = False
55

66
# _ZN17CBaseCombatWeapon13PrimaryAttackEv
77
[[primary_attack]]
8-
offset_linux = 314
9-
offset_windows = 308
8+
offset_linux = 313
9+
offset_windows = 307
1010

1111
# _ZN17CBaseCombatWeapon13SecondaryAttackEv
1212
[[secondary_attack]]
13-
offset_linux = 315
14-
offset_windows = 309
13+
offset_linux = 314
14+
offset_windows = 308
1515

1616

1717
[property]

addons/source-python/data/source-python/entities/csgo/CBasePlayer.ini

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ srv_check = False
1818

1919
# _ZN11CBasePlayer13GiveNamedItemEPKciP13CEconItemViewb
2020
[[give_named_item]]
21-
offset_linux = 450
22-
offset_windows = 449
21+
offset_linux = 451
22+
offset_windows = 450
2323
arguments = STRING, INT, POINTER, BOOL
2424
return_type = POINTER
2525

2626
# _ZN11CBasePlayer21IncrementAssistsCountEi
2727
[[increment_assists_count]]
28-
offset_linux = 492
29-
offset_windows = 491
28+
offset_linux = 493
29+
offset_windows = 492
3030
arguments = INT
3131

3232
# _ZN11CBasePlayer19IncrementDeathCountEi
3333
[[increment_death_count]]
34-
offset_linux = 493
35-
offset_windows = 492
34+
offset_linux = 494
35+
offset_windows = 493
3636
arguments = INT
3737

3838
# _ZN11CBasePlayer18IncrementFragCountEii
3939
[[increment_frag_count]]
40-
offset_linux = 491
41-
offset_windows = 490
40+
offset_linux = 492
41+
offset_windows = 491
4242
arguments = INT, INT
4343

4444
# _ZN11CBasePlayer16PlayerRunCommandEP8CUserCmdP11IMoveHelper
@@ -61,8 +61,8 @@ srv_check = False
6161
[instance_attribute]
6262

6363
[[assists]]
64-
offset_windows = 3908
65-
offset_linux = 3932
64+
offset_windows = 3816
65+
offset_linux = 3840
6666
type = INT
6767

6868

addons/source-python/data/source-python/entities/csgo/CCSPlayer.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ srv_check = False
1212
[[buy_internal]]
1313
identifier_windows = 55 8B EC 83 E4 F8 81 EC 7C 01 00 00 53 56 57
1414
# indentifier_linux = _ZN9CCSPlayer26HandleCommand_Buy_InternalEPKcib
15-
identifier_linux = 55 89 E5 57 56 53 81 EC 9C 01 00 00 0F B6 55 14
16-
arguments = STRING, INT, BOOL
15+
identifier_linux = 55 89 E5 83 EC 68 0F B6 55 14
16+
arguments = INT, STRING, BOOL
1717
return_type = INT
1818

1919
[[deafen]]
@@ -43,8 +43,8 @@ srv_check = False
4343

4444
# _ZN9CCSPlayer5BlindEfff
4545
[[blind]]
46-
offset_linux = 541
47-
offset_windows = 538
46+
offset_linux = 542
47+
offset_windows = 539
4848
arguments = FLOAT, FLOAT, FLOAT
4949

5050

@@ -56,13 +56,13 @@ srv_check = False
5656
[instance_attribute]
5757

5858
[[mvps]]
59-
offset_windows = 11752
60-
offset_linux = 11776
59+
offset_windows = 11472
60+
offset_linux = 11496
6161
type = INT
6262

6363
[[clan_tag]]
64-
offset_windows = 10588
65-
offset_linux = 10612
64+
offset_windows = 9524
65+
offset_linux = 9548
6666
type = STRING_ARRAY
6767

6868

addons/source-python/packages/source-python/weapons/restrictions.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# Source.Python Imports
1313
# Core
1414
from core import AutoUnload
15+
from core import SOURCE_ENGINE
1516
# Entities
1617
from entities.constants import INVALID_ENTITY_INDEX
1718
from entities.helpers import edict_from_pointer
@@ -391,8 +392,14 @@ def _on_weapon_bump(args):
391392
@EntityPreHook(EntityCondition.is_player, 'buy_internal')
392393
def _on_weapon_purchase(args):
393394
"""Return whether the player is allowed to purchase the weapon."""
395+
# TODO:
396+
# In CS:GO it seems like the weapon isn't passed as a string anymore.
397+
# Instead it's rather a pointer that might be NULL. If it's not NULL, the
398+
# function sets it to some value:
399+
#if ( a3 )
400+
# *(_DWORD *)a3 = v16;
394401
return weapon_restriction_manager.on_player_purchasing_weapon(
395-
make_object(Player, args[0]), args[1])
402+
make_object(Player, args[0]), args[1 if SOURCE_ENGINE != 'csgo' else 2])
396403

397404

398405
# =============================================================================

0 commit comments

Comments
 (0)