ScriptCore3.weap2menu

From Soldat Community Wiki
Revision as of 18:28, 1 May 2018 by Morko (talk | contribs)
Jump to: navigation, search
function weap2menu(Style: Byte): Byte
 Style: Position(Style) of the weapon in the TWeapon.WType
 Result: Position(Style) of the weapon in the Weapons List

Description

Translates the position of the weapon in the WType property of a Weapon Object (TWeapon.WType) to the corresponding position in the Weapon Menu (Weapons List).

Examples

begin
    WriteLn('weap2menu: '+inttostr(weap2menu(1))); //1
    WriteLn('weap2menu: '+inttostr(weap2menu(13))); //14
    WriteLn('weap2menu: '+inttostr(weap2menu(15))); //Exception: Invalid weapon style (Well played, Robin Hood!)
end.