Skip to content

Commit

Permalink
Update zscript version, fix MANY warnings
Browse files Browse the repository at this point in the history
I'm pretty sure this will break shit. Oh well.
  • Loading branch information
caligari87 committed Sep 12, 2020
1 parent 41ea3f4 commit b47d43a
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions modules/ai/flashlight.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extend class UaS_AI_Handler {
int flashrate;

void Flashlight() {
if (globalfreeze || level.Frozen) { return; }
if (owner.isFrozen() || level.isFrozen()) { return; }
// Only do light for human-type classes
bool BotClass = (
owner is "HERPBot" ||
Expand All @@ -30,7 +30,7 @@ extend class UaS_AI_Handler {
// sample light from ahead of monster
FLineTraceData lookSpot;
owner.LineTrace(owner.angle, 256, owner.pitch, TRF_THRUACTORS, owner.height * 0.75, data: lookSpot);
double lightlevel = (lookSpot.HitSector.LightLevel + owner.cursector.lightlevel) / 2;
int lightlevel = int(lookSpot.HitSector.LightLevel + owner.cursector.lightlevel) / 2;

// More likely to activate in darker areas
if (random[aillm](0,192) > lightlevel) { llm.activated = true; }
Expand Down
2 changes: 1 addition & 1 deletion modules/ai/searching.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extend class UaS_AI_Handler {
if(owner.health <= 0) { return; }

// Normal following behavior plus visibility checks
if (owner.target && owner.target.CheckClass("HDPlayerPawn", AAPTR_DEFAULT, true)) {
if (owner.target && owner.target is "HDPlayerPawn") {
if (lastknown) { lastKnown.destroy(); }

// Clear ambush flag if needed
Expand Down
8 changes: 4 additions & 4 deletions modules/ai/stealth.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class UaS_StealthHandler : Inventory {
if (!owner || !owner.player) { return; }
if (!UaS_AI_Stealth) { return; }

threshold = (56.0 / owner.player.crouchfactor) - (owner.vel.length() * 5);
threshold = int((56.0 / owner.player.crouchfactor) - (owner.vel.length() * 5));

stealth -= clamp((GetLightLevel() - threshold), -3, 3);
stealth = clamp(stealth, 0, 100);
Expand All @@ -39,7 +39,7 @@ class UaS_StealthHandler : Inventory {

// Iterate lights
while (currentLight = DynamicLight(LightFinder.Next())) {
if (currentLight.CheckClass("VisorLight")) { continue; } // Skip HD's nightvision visor light
if (currentLight is "VisorLight") { continue; } // Skip HD's nightvision visor light
if (!currentLight.CheckSight(owner)) { continue; } //Skip if the light isn't in LoS

vector3 posdiff = levellocals.Vec3Diff((owner.pos.x, owner.pos.y, owner.pos.z + (owner.height / 2)), currentlight.pos);
Expand Down Expand Up @@ -68,12 +68,12 @@ class UaS_StealthHandler : Inventory {
// Special handling for Steve's Flashlight
// This is a disgusting hack, BTW
string steves = "ActorHeadLight";
if (currentLight.CheckClass(steves) && posdiff.xy.length() < owner.radius) { avgIntensity *= 100; }
if (currentLight.GetClass() == steves && posdiff.xy.length() < owner.radius) { avgIntensity *= 100; }

// Handle dormant lights
if (currentLight.bDORMANT) { avgIntensity = 0; }

trueLightLevel = max(trueLightLevel, avgIntensity);
trueLightLevel = int(max(trueLightLevel, avgIntensity));
}
if (UaS_Debug & Stealth) { owner.A_Log("Stealth "..stealth.." - LightLevel "..trueLightLevel.." - threshold "..threshold); }
return trueLightLevel;
Expand Down
2 changes: 1 addition & 1 deletion modules/ai/wounded.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extend class UaS_AI_Handler {

if(UaS.randomChance(1.0 - healthFactor)) { owner.bFRIGHTENED = true; }
else { owner.bFRIGHTENED = false; }
painCountDown = random[ai](5, 10) * 35 * healthFactor;
painCountDown = int(random[ai](5, 10) * 35 * healthFactor);
}
painCountdown = max(painCountDown - 1, 0);

Expand Down
2 changes: 1 addition & 1 deletion modules/allies/spawner.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extend class UaS_Spawner {
}

class UaS_Ally_Activator : Inventory {
int closestPlayer;
double closestPlayer;
bool LoSPlayer;

override void DoEffect() {
Expand Down
24 changes: 12 additions & 12 deletions modules/hunger/messkit.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class UaS_MessKit : HDWeapon {
TNT1 A random(15,20) UaS_OpenWater();
goto nope;
Swallow:
TNT1 A random(8,12) A_PlaySound("weapons/pocket");
TNT1 A random(8,12) A_StartSound("weapons/pocket");
goto nope;
User4:
Toss:
Expand Down Expand Up @@ -160,7 +160,7 @@ class UaS_MessKit : HDWeapon {
TrackerStatusMessage("You're full.\nCouldn't drink another drop.");
return ResolveState("nope");
}
A_PlaySound("misc/smallslop");
A_StartSound("misc/smallslop");
return ResolveState("Sip");
}
invoker.UaS_TossOpened(false);
Expand All @@ -170,20 +170,20 @@ class UaS_MessKit : HDWeapon {
//Takes a random-sized "bite" of the food
action void UaS_TakeScoop() {
double difference = clamp(2500 - invoker.tracker.calories, 0, 500);
A_PlaySound("UaS/FoodScoop", CHAN_AUTO, frandom(0.3, 0.6));
invoker.biteSize = min(invoker.mealsize, 75 * invoker.speedFactor) * frandom(0.75,1.0);;
invoker.biteSize *= (difference / 500.0);
invoker.biteSize = clamp(invoker.biteSize, 1, 75 * invoker.speedFactor);
A_StartSound("UaS/FoodScoop", CHAN_AUTO, volume: frandom(0.3, 0.6));
invoker.biteSize = int(min(invoker.mealsize, 75 * invoker.speedFactor) * frandom(0.75,1.0));
invoker.biteSize *= int(difference / 500.0);
invoker.biteSize = int(clamp(invoker.biteSize, 1, 75 * invoker.speedFactor));
}

//"Chew" the food
action state UaS_Consume() {
invoker.tracker = UaS_HungerTracker(FindInventory("UaS_HungerTracker", false));
if(invoker.bitesize > 0) {
//Chew
int chunk = random(1,10) * invoker.speedFactor;
A_PlaySound("weapons/pocket", CHAN_AUTO, frandom(0.25, 0.6));
A_PlaySound("misc/fragroll", CHAN_AUTO, frandom(0.25, 0.7));
int chunk = int(random(1,10) * invoker.speedFactor);
A_StartSound("weapons/pocket", CHAN_AUTO, volume: frandom(0.25, 0.6));
A_StartSound("misc/fragroll", CHAN_AUTO, volume: frandom(0.25, 0.7));
invoker.mealSize -= clamp(chunk, 0, invoker.biteSize);
invoker.tracker.calories += clamp(chunk, 0, invoker.biteSize);
invoker.biteSize -= clamp(chunk, 0, invoker.biteSize);
Expand All @@ -196,7 +196,7 @@ class UaS_MessKit : HDWeapon {
//Consume a random amount of water "drops" to simulate drinking
action state UaS_Sip() {
invoker.tracker = UaS_HungerTracker(FindInventory("UaS_HungerTracker", false));
int drops = random(1,2) * invoker.speedFactor;
int drops = int(random(1,2) * invoker.speedFactor);
for(int i = 1; i <= drops; i++) {
invoker.sipsize += 1;
invoker.tracker.water += 1;
Expand All @@ -215,7 +215,7 @@ class UaS_MessKit : HDWeapon {
if(countinv("UaS_FoodRation") > 0) {
if(invoker.mealSize < 500) {
invoker.owner.TakeInventory("UaS_FoodRation",1);
A_PlaySound("imp/melee");
A_StartSound("imp/melee");
invoker.mealSize += random(5, 10) * 25;
//invoker.flavor = RandomFlavor();
TrackerStatusMessage("Opened Food Ration!");
Expand All @@ -234,7 +234,7 @@ class UaS_MessKit : HDWeapon {
if(countinv("UaS_WaterRation") > 0) {
if(invoker.drinksize < 500) {
invoker.owner.TakeInventory("UaS_WaterRation",1);
A_PlaySound("misc/smallslop");
A_StartSound("misc/smallslop");
invoker.drinkSize += random(40, 50) * 5;
TrackerStatusMessage();
}
Expand Down
6 changes: 3 additions & 3 deletions modules/hunger/tracker.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class UaS_HungerTracker : CustomInventory {
if(foodfatigue < 0) { foodfatigue = 0; }
if(waterfatigue < 0) { waterfatigue = 0; }
double minfatigue = max(foodfatigue, waterfatigue);
ownr.fatigue = max(ownr.fatigue, minfatigue);
ownr.fatigue = int(max(ownr.fatigue, minfatigue));

//Reduce calories
double foodburn = (1 / minute) * max(calories / 1500, 0.75) * frandom[hunger](0.95, 1.05);
Expand Down Expand Up @@ -88,7 +88,7 @@ class UaS_HungerTracker : CustomInventory {
else if(calories >= 250 && calories < 500) { statusMessage = statusMessage.."Your stomach aches. "; }
else if(calories >= 0 && calories < 250) { statusMessage = statusMessage.."Your stomach clenches. "; }
//Last meal messages
int mealdelta = (lastmeal - calories);
int mealdelta = int(lastmeal - calories);
if(mealdelta >= 500 && mealdelta <1000) { statusMessage = statusMessage.."Time for another meal?"; }
else if(mealdelta >= 1000 && mealdelta <1500) { statusMessage = statusMessage.."It's been a while since you ate. "; }
else if(mealdelta >= 1500 && mealdelta <2000) { statusMessage = statusMessage.."When did you last eat? "; }
Expand All @@ -113,7 +113,7 @@ class UaS_HungerTracker : CustomInventory {
else if(water >= 250 && water < 500) { statusMessage = statusMessage.."Your mouth is dry. "; }
else if(water >= 0 && water < 250) { statusMessage = statusMessage.."Your throat is parched. "; }
//Last drink messages
int drinkdelta = (lastdrink - water);
int drinkdelta = int(lastdrink - water);
if(drinkdelta >= 500 && drinkdelta <1000) { statusMessage = statusMessage.."Time for another drink?"; }
else if(drinkdelta >= 1000 && drinkdelta <1500) { statusMessage = statusMessage.."It's been a while since you drank something. "; }
else if(drinkdelta >= 1500 && drinkdelta <2000) { statusMessage = statusMessage.."When did you last have some water? "; }
Expand Down
4 changes: 2 additions & 2 deletions modules/items/2f.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UaS_2F_Handler : Inventory {
if(HDMedikitter(ownr.player.ReadyWeapon).weaponstatus[MEDS_SECONDFLESH] >= 7) {
HDMedikitter(ownr.player.ReadyWeapon).weaponstatus[MEDS_SECONDFLESH] -= 7;
owner.A_GiveInventory('UaS_2FCartridge', 1);
owner.A_PlaySound("weapons/rifleclick", volume: 0.5);
owner.A_StartSound("weapons/rifleclick", volume: 0.5);
cooldown = 20;
}
else { HDMedikitter(ownr.player.ReadyWeapon).A_WeaponMessage("Can't remove partial auto-suture cartridge", 70); }
Expand All @@ -28,7 +28,7 @@ class UaS_2F_Handler : Inventory {
if(HDMedikitter(ownr.player.ReadyWeapon).weaponstatus[MEDS_SECONDFLESH] <= MEDIKIT_MAXFLESH - 7) {
HDMedikitter(ownr.player.ReadyWeapon).weaponstatus[MEDS_SECONDFLESH] += 7;
owner.A_TakeInventory('UaS_2FCartridge', 1);
owner.A_PlaySound("weapons/rifleload", volume: 0.75);
owner.A_StartSound("weapons/rifleload", volume: 0.75);
cooldown = 20;
}
else { HDMedikitter(ownr.player.ReadyWeapon).A_WeaponMessage("Not enough space to insert auto-suture cartridge", 70); }
Expand Down
2 changes: 1 addition & 1 deletion modules/items/flare.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class UaS_Flare : HDPickup {
FlareLight.args[DynamicLight.LIGHT_GREEN] = 160;
FlareLight.args[DynamicLight.LIGHT_BLUE] = 192;
}
FlareLight.args[DynamicLight.LIGHT_INTENSITY] = 0.25 * (brightness - age) + random[flare](-4, 4);
FlareLight.args[DynamicLight.LIGHT_INTENSITY] = int(0.25 * (brightness - age) + random[flare](-4, 4));
if (owner) { FlareLight.target = owner; }
else { FlareLight.target = self; }

Expand Down
2 changes: 1 addition & 1 deletion modules/items/glowstick.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class UaS_Glowstick : HDPickup {

override bool Use(bool pickup) {
if (!Activated) {
owner.A_PlaySound("UaS/Glowstick", CHAN_AUTO, 0.15);
owner.A_StartSound("UaS/Glowstick", CHAN_AUTO, volume: 0.15);
Activated = true;;
} else { owner.DropInventory(self); }
return false;
Expand Down
8 changes: 4 additions & 4 deletions modules/items/sling.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class UaS_WeaponSling : HDPickup {
slingPrep = max(slingPrep - 45, 0);
}

if(slingPrep == 40 || slingPrep == 315) { owner.A_PlaySound("weapons/pocket", CHAN_WEAPON, 0.25); }
if(slingPrep == 340) { owner.A_PlaySound("weapons/rifleclick2",CHAN_BODY,0.3); }
if(slingPrep == 40 || slingPrep == 315) { owner.A_StartSound("weapons/pocket", CHAN_WEAPON, volume: 0.25); }
if(slingPrep == 340) { owner.A_StartSound("weapons/rifleclick2", CHAN_BODY, volume: 0.3); }


//Enable or disable on completion
Expand Down Expand Up @@ -165,8 +165,8 @@ class UaS_WeaponSling : HDPickup {
if(weapName == invoker.weaponList[i]) { validWeapon = true; }
}
if(validWeapon || currentWeapon.weaponspecial == 1337) {
A_PlaySound("misc/fragknock", CHAN_BODY, 0.3);
A_PlaySound("misc/casing", CHAN_WEAPON, 0.3);
A_StartSound("misc/fragknock", CHAN_BODY, volume: 0.3);
A_StartSound("misc/casing", CHAN_WEAPON, volume: 0.3);
invoker.attachedPoints++;
invoker.attachedWeapon = currentWeapon.GetClassName();
if(getcvar("hd_helptext")) { currentWeapon.A_WeaponMessage("Attached a sling point ("..invoker.attachedPoints.." of 2).", 70); }
Expand Down
2 changes: 1 addition & 1 deletion modules/items/traumakit/traumakit_forceps.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extend class UaS_TraumaKit {
}

if (mashes > 0) {
int remove = frandom[uas_tk](2,4) * mashes;
int remove = random[uas_tk](2,4) * mashes;
string result;

if (currentWound.obstructed > 0 && mashes > 1) {
Expand Down
2 changes: 1 addition & 1 deletion modules/items/traumakit/wound.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ extend class WoundInfo {
nw.dirty = max(-1, randompick[uas_wi](-1, 1, 1, 1) * random[uas_wi](sizemin, sizemax));
nw.obstructed = max(-1, randompick[uas_wi](-1, 1) * random[uas_wi](sizemin, sizemax));
nw.cavity = max(-1, randompick[uas_wi](-1, 1, 1) * random[uas_wi](sizemin, sizemax));
nw.infection = (nw.dirty + nw.obstructed + nw.open + nw.cavity) * 0.25;
nw.infection = (nw.dirty + nw.obstructed + nw.open + nw.cavity) / 4;
nw.open = random[uas_wi](sizemin, sizemax);
nw.timer = (random[uas_wi](10, 30) * 35);
nw.size = newsize;
Expand Down
10 changes: 5 additions & 5 deletions modules/looting/looting.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class UaS_Looting_Handler : Inventory {
currentWeapon.A_WeaponMessage(searchMarker.lastMessage);
return;
}
owner.A_PlaySound("weapons/pocket", frandom(0.0, 0.5));
owner.A_StartSound("weapons/pocket", volume: frandom(0.0, 0.5));
searchMarker.searchedAmount += frandom(0.05, 0.1);
anglevel += frandom[loot](-1, 1);
pitchvel += frandom[loot](-1, 1);
Expand All @@ -92,7 +92,7 @@ class UaS_Looting_Handler : Inventory {
int maxAmount = 0;
double rarityFactor = 0;

if(spawnTarget.CheckClass("ZombieStormtrooper", AAPTR_DEFAULT, true)) {
if(spawnTarget is "ZombieStormtrooper") {
int weapontype = ZombieStormtrooper(spawnTarget).firemode;
switch(weapontype) {
case -2:
Expand All @@ -113,7 +113,7 @@ class UaS_Looting_Handler : Inventory {
break;
}
}
if(spawnTarget.CheckClass("HideousShotgunGuy", AAPTR_DEFAULT, true)) {
if(spawnTarget is "HideousShotgunGuy") {
int weapontype = HideousShotgunGuy(spawnTarget).wep;
switch(weapontype) {
case -1:
Expand All @@ -134,15 +134,15 @@ class UaS_Looting_Handler : Inventory {
break;
}
}
if(spawnTarget.CheckClass("VulcanetteGuy", AAPTR_DEFAULT, true)) {
if(spawnTarget is "VulcanetteGuy") {
tableSize = DragonGuardLoot.Size() - 1;
lootIndex = random(0, tableSize);
LootClass = DragonGuardLoot[lootIndex].itemName;
minAmount = DragonGuardLoot[lootIndex].minAmount;
maxAmount = DragonGuardLoot[lootIndex].maxAmount;
rarityFactor = DragonGuardLoot[lootIndex].rarityFactor;
}
if(spawnTarget.CheckClass("HDMarine", AAPTR_DEFAULT, true)) {
if(spawnTarget is "HDMarine") {
int weapontype = HDMarine(spawnTarget).wep;
switch(weapontype) {
case 1:
Expand Down
6 changes: 3 additions & 3 deletions modules/scarcity/handler_helpers.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extend class UaS_Scarcity_Handler {
//Generic function for breaking/replacing map-spawned magazines
void MagReplacer(name MagName, name ammoName, int MagCap, actor spawnPointer) {
int rounds, packed;
MagCap *= min(OverspawnFactor - ScarcityFactor, 1.0); //Possible spawn at least *some* ammo, based on overspawn
MagCap = int(MagCap * min(OverspawnFactor - ScarcityFactor, 1.0)); //Possible spawn at least *some* ammo, based on overspawn
rounds = random(0, MagCap); //Pick a number up to cap
//Pack some in a mag, or no mag at all
if(UaS.RandomChance(UaS_ScarcityOverspawn)) {
Expand All @@ -17,8 +17,8 @@ extend class UaS_Scarcity_Handler {
//Generic function for reducing amount in map-spawned ammo boxes, without removal since boxes are already rare
void BoxReplacer(name BoxName, name ammoName, int BoxCap, actor spawnPointer) {
int rounds, packed;
BoxCap *= min(OverspawnFactor - ScarcityFactor, 1.0); //Possible spawn at least *some* ammo, based on overspawn
rounds = random(BoxCap * 0.5, BoxCap); //Pick a number from 50% up to cap
BoxCap = int(BoxCap * min(OverspawnFactor - ScarcityFactor, 1.0)); //Possible spawn at least *some* ammo, based on overspawn
rounds = random(int(BoxCap * 0.5), BoxCap); //Pick a number from 50% up to cap
//Pack some in a box or no box at all
if(UaS.RandomChance(UaS_ScarcityOverspawn)) {
packed = randompick(0, random(1, rounds)); //50%: pack none (spawn empty), or up to all
Expand Down
2 changes: 1 addition & 1 deletion modules/scarcity/handler_remover.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extend class UaS_Scarcity_Handler {

int originalcount = thingArray.Size();

int targetAmount = thingArray.Size() * targetPercent;
int targetAmount = int(thingArray.Size() * targetPercent);
while(thingArray.Size() > targetAmount) {
if(UaS_Debug & Scarcity) { console.printf("Modified or removed "..checkClass); }
int index = random(0, thingArray.Size()-1);
Expand Down
8 changes: 4 additions & 4 deletions modules/scarcity/handler_replacer.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ extend class UaS_Scarcity_Handler {
break;
case 'ShellPickup':
case 'HDShellAmmo':
UaS.SpawnStuff('HDFumblingShell', random(0, 4 * min(OverspawnFactor-ScarcityFactor, 1.0)), targetActor.pos, true);
UaS.SpawnStuff('HDFumblingShell', random(0, int(4 * min(OverspawnFactor-ScarcityFactor, 1.0))), targetActor.pos, true);
break;
case 'ShellBoxPickup':
BoxReplacer('ShellBoxPickup', 'HDFumblingShell', 20, targetActor);
break;
case 'HDBattery':
int MagCap = 20 * min(OverspawnFactor - ScarcityFactor, 1.0);
int MagCap = int(20 * min(OverspawnFactor - ScarcityFactor, 1.0));
if(UaS.RandomChance(UaS_ScarcityOverspawn)) { HDMagAmmo.SpawnMag(targetActor, 'HDBattery', random(0, MagCap)); }
break;
case 'RocketBigPickup':
Expand Down Expand Up @@ -63,7 +63,7 @@ extend class UaS_Scarcity_Handler {
let spawnedMedikit = HDMedikitter(actor.Spawn('HDMedikitter', targetActor.pos));
if(!spawnedMedikit) { break; }
//assume 7 auto-sutures per module, default 42 sutures = 6 modules
int maxmodules = max(1, (MEDIKIT_MAXFLESH * UaS_ScarcityOverspawn) / 6);
int maxmodules = int(max(1, (MEDIKIT_MAXFLESH * UaS_ScarcityOverspawn) / 6));
int kitmodules = max(1, random(1, maxmodules));
spawnedMedikit.weaponstatus[MEDS_SECONDFLESH] = 7 * kitmodules;
if(spawnedMedikit.weaponstatus[MEDS_SECONDFLESH] < MEDIKIT_MAXFLESH) { spawnedMedikit.frame = 2; }
Expand Down Expand Up @@ -94,7 +94,7 @@ extend class UaS_Scarcity_Handler {
avgint /= 3;
avgint *= UaS_ScarcityOverspawn;
avgint = clamp(avgint,0,400);
PortableLiteAmp(spawnedLiteAmp).setintegrity(avgint);
PortableLiteAmp(spawnedLiteAmp).setintegrity(int(avgint));
if(UaS_Debug & Scarcity) { console.printf("Liteamp integrity %i", PortableLiteAmp(spawnedLiteAmp).getintegrity()); }
break;
}
Expand Down
4 changes: 2 additions & 2 deletions modules/scarcity/items.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class UaS_Automap : HDPickup {
target = other;
A_GiveToTarget("MapRevealer",1);
A_Log("\c-Local area map downloaded.");
A_PlaySound("misc/i_pkup",0,1,0,0);
A_StartSound("misc/i_pkup",0,volume:1);
return;
break;
case 1: // Damaged
if(working) {
target = other;
A_GiveToTarget("MapRevealer",1);
A_Log("\c-Local area map downloaded.");
A_PlaySound("misc/i_pkup",0,1,0,0);
A_StartSound("misc/i_pkup",0,volume:1);
}
if(UaS.RandomChance(0.25)) { status = 2; }
return;
Expand Down
4 changes: 2 additions & 2 deletions modules/visweps/visweps.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class UaS_VisWeps_Bootstrap : EventHandler {
override void WorldThingSpawned(WorldEvent e) {
if(!e.Thing) { return; }
if(!UaS_VisWepsEnabled) { return; }
if(e.Thing.CheckClass('HDMarine', AAPTR_DEFAULT, true)) {
if(e.Thing is 'HDMarine') {
e.Thing.GiveInventory('UaS_VisWeps_Updater', 1);
}
}
Expand All @@ -19,7 +19,7 @@ class UaS_VisWeps_Updater : Inventory {
override void DoEffect() {
super.DoEffect();
let ownr = HDMarine(Owner);
if(ownr..CheckClass('HDMarine', AAPTR_DEFAULT, true) && ownr.health > 0) {
if(ownr is 'HDMarine' && ownr.health > 0) {

// Check if the marine is using their pistol
if(ownr.CurState == ownr.ResolveState("shootpistol")) {
Expand Down
Loading

0 comments on commit b47d43a

Please sign in to comment.