replace func with native one

This commit is contained in:
Shtoyan 2022-02-24 14:45:15 +04:00
parent 7fc6d92410
commit ff0782d1f2

View File

@ -515,7 +515,9 @@ function GiveProgressiveDosh(NicePlayerController nicePlayer){
record.lastCashWave = nextWave;
UpdatePlayerRecord(record);
}
simulated function Mutate(string MutateString, PlayerController kfPlayer){
simulated function Mutate(string MutateString, PlayerController kfPlayer)
{
local int i, readLenght;
local NicePlayerController nicePlayer;
local NiceServerData remoteData;
@ -529,10 +531,13 @@ simulated function Mutate(string MutateString, PlayerController kfPlayer){
// Always contains at least 10 elements, that may be empty strings if there wasn't enough modifiers.
// Done for safe access without the need to check for bounds.
local array<String> modArray;
super.Mutate(MutateString, kfPlayer);
// Helpful sequence
white = chr(27)$chr(200)$chr(200)$chr(200);
// Transform our command into array for convenience
wordsArray = SplitString(MutateString, " ");
Split(MutateString, " ", wordsArray);
// Exit if command is empty
if(wordsArray.Length == 0)
return;
@ -627,7 +632,6 @@ simulated function Mutate(string MutateString, PlayerController kfPlayer){
nicePlayer.ClientMessage("Compressed lenght:" @ string(inputStream.GetSizeInBytes()) );
nicePlayer.ClientMessage("Output:"@outputStream.ReadClassName(readLenght));
}
Super.Mutate(MutateString, kfPlayer);
}
/* Good test for writer
else if(command ~= "TEST"){
@ -815,48 +819,7 @@ function BroadcastSkills(){
}
}
}
// Function for string splitting, because why would we have it as a standard function? It would be silly, right?
function array<string> SplitString(string inputString, string div){
local array<string> parts;
local bool bEOL;
local string tempChar;
local int preCount, curCount, partCount, strLength;
strLength = Len(inputString);
if(strLength == 0)
return parts;
bEOL = false;
preCount = 0;
curCount = 0;
partCount = 0;
while(!bEOL)
{
tempChar = Mid(inputString, curCount, 1);
if(tempChar != div)
curCount ++;
else
{
if(curCount == preCount)
{
curCount ++;
preCount ++;
}
else
{
parts[partCount] = Mid(inputString, preCount, curCount - preCount);
partCount ++;
preCount = curCount + 1;
curCount = preCount;
}
}
if(curCount == strLength)
{
if(preCount != strLength)
parts[partCount] = Mid(inputString, preCount, curCount);
bEOL = true;
}
}
return parts;
}
// Function for broadcasting messages to players
function BroadcastToAll(string message){
local Controller P;