MantisBT - Soldat Dedicated Server
View Issue Details
0000355Soldat Dedicated ServerScripting Corepublic2013-07-30 12:562013-08-02 21:21
Mighty 
Falcon 
normalminoralways
resolvedfixed 
x86WindowsXP SP3
2.7.4 
 
0000355: Script Core 3 - TPlayer.OnWeaponChange triggers 3 times instead of 1
When having 2 different weapons, switching between them just once triggers Player.OnWeaponChange 3 times
Use below code as a script using Script Core 3

procedure OnWepChangeMessage(Player: TActivePlayer; Primary, Secondary: TPlayerWeapon);
begin
  Player.Tell(Primary.Name + ' | ' + Secondary.Name);
end;
 
var
  i: Byte;
begin
  for i:=1 to 32 do
    Players[i].OnWeaponChange := @OnWepChangeMessage;
end.
No tags attached.
Issue History
2013-07-30 12:56MightyNew Issue
2013-07-30 16:22FalconNote Added: 0001797
2013-07-30 16:22FalconAssigned To => Falcon
2013-07-30 16:22FalconStatusnew => acknowledged
2013-07-31 08:23MightyNote Added: 0001804
2013-07-31 10:19MightyNote Edited: 0001804bug_revision_view_page.php?bugnote_id=1804#r218
2013-08-02 21:21FalconStatusacknowledged => resolved
2013-08-02 21:21FalconResolutionopen => fixed

Notes
(0001797)
Falcon   
2013-07-30 16:22   
Does OnWeaponChange do the same?
(0001804)
Mighty   
2013-07-31 08:23   
(edited on: 2013-07-31 10:19)
what do you mean? This is OnWeaponChange
Edit: Oh I get it. Yes it does.