mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-13 07:04:33 +00:00
No-Schedule MineDisc Detection
This commit is contained in:
parent
f077a873f3
commit
7e134b8d2d
1 changed files with 16 additions and 20 deletions
|
|
@ -2800,27 +2800,23 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
%flash = 0.75;
|
%flash = 0.75;
|
||||||
|
|
||||||
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
||||||
// client.mineDisc = [true|false]
|
// No Schedules by DarkTiger
|
||||||
// client.mineDiscCheck [0-None|1-Disc Damage|2-Mine Damage]
|
|
||||||
// Teratos: Don't understand why "%client = %targetClient;" -- possibly to avoid carrying .minediscCheck field?
|
|
||||||
// Teratos: A little more redundant code and less readable for a few less comparisons.
|
|
||||||
%targetClient.mineDisc = false;
|
%targetClient.mineDisc = false;
|
||||||
if(%damageType == $DamageType::Disc) {
|
switch$(%damageType)
|
||||||
%client = %targetClient; // Oops
|
{
|
||||||
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
case $DamageType::Disc:
|
||||||
%client.minediscCheck = 1;
|
if(%targetClient.mdc == 1 && (getSimTime() - %targetClient.mdcTime1) < 256)
|
||||||
schedule(300, 0, "resetMineDiscCheck", %client);
|
%targetClient.mineDisc = true;
|
||||||
} else if(%client.minediscCheck == 2) { // Recent Mine damage
|
|
||||||
%client.mineDisc = true;
|
%targetClient.mdc = 2;
|
||||||
}
|
%targetClient.mdcTime2 = getSimTime();
|
||||||
} else if (%damageType == $DamageType::Mine) {
|
|
||||||
%client = %targetClient; // Oops
|
case $DamageType::Mine:
|
||||||
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
if(%targetClient.mdc == 2 && (getSimTime() - %targetClient.mdcTime2) < 256)
|
||||||
%client.minediscCheck = 2;
|
%targetClient.mineDisc = true;
|
||||||
schedule(300, 0, "resetMineDiscCheck", %client);
|
|
||||||
} else if(%client.minediscCheck == 1) { // Recent Disc damage
|
%targetClient.mdc = 1;
|
||||||
%client.mineDisc = true;
|
%targetClient.mdcTime1 = getSimTime();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// -- End Mine+Disc insert.
|
// -- End Mine+Disc insert.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue