Allow cheats to convert units to arbitrary players.
This allows the "wololo" cheat to switch units to an arbitrarily defined player. If no player is specified, it defaults to the player entering the cheat. The player manager will warn when using a wrong player number. Patch by: @Nullus Differential revision: https://code.wildfiregames.com/D4479 Comments by: @Stan This was SVN commit r26328.
This commit is contained in:
parent
9417a345d1
commit
93b22c5f86
@ -194,6 +194,7 @@
|
||||
{ "nick": "NoMonkey", "name": "John Mena" },
|
||||
{ "nick": "norsnor" },
|
||||
{ "nick": "notpete", "name": "Rich Cross" },
|
||||
{ "nick": "Nullus" },
|
||||
{ "nick": "nwtour" },
|
||||
{ "nick": "odoaker", "name": "Ágoston Sipos" },
|
||||
{ "nick": "Offensive ePeen", "name": "Jared Ryan Bills" },
|
||||
|
@ -1,6 +1,8 @@
|
||||
{
|
||||
"Name": "wololo",
|
||||
"Data": {
|
||||
"Action": "convertunit"
|
||||
"Action": "convertunit",
|
||||
"DefaultParameter": -1,
|
||||
"isNumeric": true
|
||||
}
|
||||
}
|
||||
|
@ -35,11 +35,12 @@ function Cheat(input)
|
||||
return;
|
||||
}
|
||||
case "convertunit":
|
||||
const playerID = (input.parameter > 1 && QueryPlayerIDInterface(input.parameter) || cmpPlayer).GetPlayerID();
|
||||
for (let ent of input.selected)
|
||||
{
|
||||
let cmpOwnership = Engine.QueryInterface(ent, IID_Ownership);
|
||||
if (cmpOwnership)
|
||||
cmpOwnership.SetOwner(cmpPlayer.GetPlayerID());
|
||||
cmpOwnership.SetOwner(playerID);
|
||||
}
|
||||
return;
|
||||
case "killunits":
|
||||
|
Loading…
Reference in New Issue
Block a user