mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-22 20:01:34 +00:00
Server: Populate Power-Up Array manually
Overcomes what is likely an FTEQCC compiler bug where just using a = b copying would result in a mis-match of first-values (id). Fixes dogs not always dropping Max Ammo's on NON-FTE.
This commit is contained in:
parent
5e09033a07
commit
16a77c1e0f
1 changed files with 21 additions and 3 deletions
|
@ -76,6 +76,23 @@ PU_AddToStruct =
|
|||
powerup_count++;
|
||||
};
|
||||
|
||||
//
|
||||
// PU_CopyStruct(to, from)
|
||||
// Copies a powerup_struct from to.
|
||||
//
|
||||
powerup_struct(powerup_struct to, powerup_struct from) PU_CopyStruct =
|
||||
{
|
||||
to.id = from.id;
|
||||
to.occupied = from.occupied;
|
||||
to.flash_screen = from.flash_screen;
|
||||
to.model_path = from.model_path;
|
||||
to.voiceover_path = from.voiceover_path;
|
||||
to.function = from.function;
|
||||
to.requirement_function = from.requirement_function;
|
||||
|
||||
return to;
|
||||
}
|
||||
|
||||
//
|
||||
// PU_PopulateArray()
|
||||
// Generates a Power-Up array with the Fisher-Yates shuffle
|
||||
|
@ -89,9 +106,10 @@ void() PU_PopulateArray =
|
|||
amount -= 1;
|
||||
|
||||
powerup_struct temp;
|
||||
temp = powerup_array[i];
|
||||
powerup_array[i] = powerup_array[amount];
|
||||
powerup_array[amount] = temp;
|
||||
|
||||
PU_CopyStruct(temp, powerup_array[i]);
|
||||
PU_CopyStruct(powerup_array[i], powerup_array[amount]);
|
||||
PU_CopyStruct(powerup_array[amount], temp);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue