Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed unloading for single DMR #445

Merged
merged 5 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions actors/Weapons/Slot4/HMGWeapon.dec
Original file line number Diff line number Diff line change
Expand Up @@ -831,9 +831,15 @@ Steady:

NoAmmo:
TNT1 A 0 A_JumpIfInventory("JavelinMode", 1, 2)
N1N0 D 10 A_PlaySound("weapons/empty")
N1N0 D 10 {
A_PlaySound("weapons/empty");
if (CountInv("HMGAmmo") <= 1) { A_SetWeaponSprite ("N1N1"); }
}
Goto Ready3
J0N1 D 10 A_PlaySound("weapons/empty")
J0N1 D 10 {
A_PlaySound("weapons/empty");
if (CountInv("HMGAmmo") >= 20) { A_SetWeaponSprite ("J0N0"); }
}
Goto JavelinReady3

Reload:
Expand Down Expand Up @@ -949,6 +955,7 @@ Steady:
Loop

ReloadJavelin:
TNT1 A 0 A_JumpIf(CountInv("NewClip") < 1, "NoAmmo") // <~ Added to fix the reload without reserve ammo bug.
TNT1 A 0 {
//Smart Check Inventory
if (CountInv("NailgunHasUnloaded") == 1) { return state("ReloadJavelinContinuedFromUnloaded"); }
Expand Down
2 changes: 1 addition & 1 deletion actors/Weapons/Slot4/PBRIFLE.dec
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ ACTOR Rifle : PB_Weapon
Unload:
TNT1 A 0 A_JumpIfInventory("HasUnloadedDMR", 1, "AlreadyUnloaded")
TNT1 A 0 A_JumpIfInventory("DualWieldingDMRs", 1, "UnloadDualWield")
TNT1 A 0 A_JumpIfInventory("",1,1)
TNT1 A 0 A_JumpIfInventory("RifleAmmo",1,1)
Goto NoAmmo
TNT1 A 0 {
A_Takeinventory("Zoomed",1);
Expand Down
14 changes: 13 additions & 1 deletion zscript/Monsters/ZombieMen/ZombieScientist.zc
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,22 @@ Class PB_ZombieScientist : PB_Monster
// }

void A_SmartChase() {

if (willBeLooking)
{
// Terminate function immediately if called inside A_LookEx.
return;
}
// Target must be cleared out if it is a friend of the monster, else we get infinite function recursions.
if (target && (target is "PossessionWarperA" || isFriend(target)))
{
A_ClearTarget();
target = NULL;
}
if (target == NULL) {
A_GiveInventory("Wandering",1);
willBeLooking = true;
A_LookEx();
willBeLooking = false;;
A_Wander();
return;
}
Expand Down