Skip to content

Commit

Permalink
Fix multiplayer desyncs
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicFrog committed Oct 23, 2022
1 parent 58f0e28 commit 1467125
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 22 deletions.
17 changes: 5 additions & 12 deletions NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@

Slomo option instead of timestop?

### 0.9.4

make rapid fire work on things that have 1-tic frames
clarify how the custom levelup sound cvar works
? figure out XP wraparound ? maybe fixed
stop including PENTAHUD and other badlumps
add secondary upgrade support to elemental sythesis by implenting ::Dot.CopyFrom
rapid fire wears off on level transitions and you need to switch weapons to reapply it
nullpointer when attacking upgraded centaurs in Serpent Resurrection:
Called from TFLV_Upgrade_Thunderbolt_Aux.PostBeginPlay at GunBonsai-0.9.3.pk3:ca.ancilla.bonsai/upgrades/lightning.zsc, line 461
co-op doesn't work at all (maybe bump this to 0.10)

### 0.9.x

- scavenge lead probabalistic below 100hp & for ammo that produces low amounts
Expand All @@ -25,6 +13,11 @@ co-op doesn't work at all (maybe bump this to 0.10)
- raised enemies don't collide with player projectiles, if possible
- Shield upgrade rework
- rather than a flat damage reduction, have it charge up when making kills in melee, and gradually fade when not doing so
- clarify how the custom levelup sound cvar works
- stop including PENTAHUD and other badlumps
- nullpointer when attacking upgraded centaurs in Serpent Resurrection:
- Called from TFLV_Upgrade_Thunderbolt_Aux.PostBeginPlay at GunBonsai-0.9.3.pk3:ca.ancilla.bonsai/upgrades/lightning.zsc, line 461


### 0.10.x?

Expand Down
5 changes: 5 additions & 0 deletions gun-bonsai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.9.5

- Fix:
- Multiplayer should now stay synced

# 0.9.4

- New:
Expand Down
2 changes: 1 addition & 1 deletion gun-bonsai/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME=GunBonsai
VERSION=0.9.4
VERSION=0.9.5
LUMPS=zscript.txt LANGUAGE.* sprites sounds *.md COPYING.freedoom
LUMPS+=MAPINFO CVARINFO SNDINFO KEYCONF MENUDEF GLDEFS BONSAIRC
ZSDIR=ca.ancilla.bonsai
Expand Down
2 changes: 1 addition & 1 deletion gun-bonsai/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Gun Bonsai

Gun Bonsai is a mod about growing your weapons from delicate pain saplings into beautiful murder trees. It is designed for maximum compatibility, and pairs well with total conversions and monster/weapon replacements, especially ones that increase the overall difficulty.
Gun Bonsai is a mod about growing your weapons from delicate pain saplings into beautiful murder trees. It is designed for maximum compatibility; it works in both gzDoom and lzDoom, supports multiplayer, and pairs well with total conversions and monster/weapon replacements, especially ones that increase the overall difficulty.

As you fight the hordes of hell, your weapons will gain XP based on how much damage you do and what you're attacking. Once a weapon levels up, you can open the info screen to browse a list of randomly selected upgrades (four by default), of which you can pick one. Higher levels take more XP to earn, but some upgrades can only be unlocked on high-level weapons.

Expand Down
12 changes: 5 additions & 7 deletions gun-bonsai/ca.ancilla.bonsai/EventHandler.zs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ::EventHandler : StaticEventHandler {
// Check for pending level ups and apply those if present.
if (stats.GetInfoForCurrentWeapon() && stats.GetInfoForCurrentWeapon().StartLevelUp()) return;
if (stats.StartLevelUp()) return;
Menu.SetMenu("GunBonsaiStatusDisplay");
if (p == consoleplayer) Menu.SetMenu("GunBonsaiStatusDisplay");
return;
}

Expand All @@ -154,9 +154,7 @@ class ::EventHandler : StaticEventHandler {
}

override void NetworkProcess(ConsoleEvent evt) {
if (evt.player != consoleplayer) {
return;
} else if (evt.name == "bonsai-show-info") {
if (evt.name == "bonsai-show-info") {
ShowInfo(evt.player);
} else if (evt.name == "bonsai-cycle-ld-effect") {
if (::Settings.have_legendoom()) {
Expand Down Expand Up @@ -199,7 +197,7 @@ class ::EventHandler : StaticEventHandler {
DEBUG("WTD: %s inflictor=%s source=%s damage=%d type=%s flags=%X, hp=%d",
TAG(evt.thing), TAG(evt.inflictor), TAG(evt.damagesource),
evt.damage, evt.damagetype, evt.damageflags, evt.thing.health);
if (evt.damagesource == players[consoleplayer].mo
if (PlayerPawn(evt.damagesource)
&& evt.thing.bISMONSTER
&& !evt.thing.bFRIENDLY // do not award XP or trigger procs when attacking friendlies
&& evt.thing != evt.damagesource
Expand All @@ -209,7 +207,7 @@ class ::EventHandler : StaticEventHandler {
if (evt.thing.health <= 0) {
stats.OnKill(evt.inflictor, evt.thing);
}
} else if (evt.thing == players[consoleplayer].mo) {
} else if (PlayerPawn(evt.thing)) {
::PerPlayerStats.GetStatsFor(PlayerPawn(evt.thing)).OnDamageReceived(
evt.inflictor, evt.damagesource, evt.damage);
}
Expand All @@ -218,7 +216,7 @@ class ::EventHandler : StaticEventHandler {
override void WorldThingSpawned(WorldEvent evt) {
Actor thing = evt.thing;
if (!thing) return;
if (thing.bMISSILE && thing.target == players[consoleplayer].mo) {
if (thing.bMISSILE && PlayerPawn(thing.target)) {
// If it's a projectile (MISSILE flag is set) and target=player, the player
// just fired a shot. This is our chance to fiddle with its flags and whatnot.
::PerPlayerStats.GetStatsFor(thing.target).OnProjectileCreated(thing);
Expand Down
2 changes: 1 addition & 1 deletion gun-bonsai/ca.ancilla.bonsai/UpgradeGiver.zs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ::UpgradeGiver : Inventory {

DEBUG("%s claiming menu", self.GetClassName());
stats.currentEffectGiver = self;
Menu.SetMenu(menuname);
if (players[consoleplayer].mo == owner) Menu.SetMenu(menuname);
self.SetStateLabel("AwaitChoice");
}

Expand Down

0 comments on commit 1467125

Please sign in to comment.