MantisBT - Soldat Dedicated Server
View Issue Details
0000623Soldat Dedicated ServerScripting Corepublic2015-08-20 01:512015-10-07 16:19
deguix 
Shoozza 
normalminoralways
resolvedfixed 
amd64Debian GNU/Linux7.0
2.7.9b1 
2.7.9 
0000623: SC2 ForceWeapon still uses old weapon ids
I tried a SC2 script in this beta version, and tried to fix its infinite knives throwing script, but it looks really weird when I have to force a different id than what I'm checking with GetPlayerStat.
Example: Replaces any weapon that is not a knife (right), to a knife (wrong ID):

Function OnPlayerCommand(ID: Byte; Text: string): boolean;
Begin
  Case LowerCase(Text) Of
    '/test': If GetPlayerStat(ID, 'Primary') <> 11 Then ForceWeapon(ID, 14, 255, 0);
  Result:=false;
End;

Then type /test as player...
No tags attached.
Issue History
2015-08-20 01:52deguixNew Issue
2015-08-20 03:39deguixNote Added: 0002484
2015-08-20 03:54deguixNote Added: 0002485
2015-10-07 16:19ShoozzaNote Added: 0002491
2015-10-07 16:19ShoozzaStatusnew => resolved
2015-10-07 16:19ShoozzaFixed in Version => 2.7.9
2015-10-07 16:19ShoozzaResolutionopen => fixed
2015-10-07 16:19ShoozzaAssigned To => Shoozza

Notes
(0002484)
deguix   
2015-08-20 03:39   
Also happens with ForceWeaponEx.
(0002485)
deguix   
2015-08-20 03:54   
Sry to keep spamming notes... OnWeaponChange on SC2 also has the old IDs too... it seems only SC3 stuff was updated?
(0002491)
Shoozza   
2015-10-07 16:19   
GetPlayerStat with primary and secondary will return weapons ids compatible with forceweapon and forceweaponex in the future