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

Blitz FFAs allowing players to join midgame #961

Closed
Xerocoles opened this issue Jan 31, 2022 · 5 comments · Fixed by #965
Closed

Blitz FFAs allowing players to join midgame #961

Xerocoles opened this issue Jan 31, 2022 · 5 comments · Fixed by #965
Labels
bug Something isn't working

Comments

@Xerocoles
Copy link

In Blitz FFA (not team blitz, but specifically only ffa blitz) you can join from observers into the active players midgame, which absolutely ruins lots of maps of course

I tested on both Stratus and OCC, on multiple maps, it always seems to be blitz ffas in particular

@calcastor
Copy link
Contributor

tested this on OCC/BOLT private servers (which are running 3d28b3b) on the map Flappy Bird (blitz FFA arcade map). wondering if #945 is affecting it?

@CoWinkKeyDinkInc
Copy link
Contributor

I think it's more related to #960 .

@calcastor
Copy link
Contributor

calcastor commented Jan 31, 2022

I think it's more related to #960 .

that was my initial thought, however the Stratus fork this was tested on has #945 but not #960 to my knowledge. the Stratus fork this was tested on has a different change to fix what #960 solved.

edit: the aforementioned change (won't apply upstream as it applies onto a previous version of #951)

index 6114b1f6..6e3b97fd 100644
--- a/core/src/main/java/tc/oc/pgm/stats/StatsMatchModule.java
+++ b/core/src/main/java/tc/oc/pgm/stats/StatsMatchModule.java
@@ -103,8 +103,10 @@ public class StatsMatchModule implements MatchModule, Listener {
         Math.min(event.getFinalDamage(), ((Player) event.getEntity()).getHealth())
             + absorptionHearts;
 
-    if (damager != null) getPlayerStat(damager).onDamage(realFinalDamage, bow);
-    if (damaged != null) getPlayerStat(damaged).onDamaged(realFinalDamage, bow);
+    if (damager != null) {
+      getPlayerStat(damager).onDamage(realFinalDamage, bow);
+      getPlayerStat(damaged).onDamaged(realFinalDamage, bow);
+    }
   }
 
   @EventHandler```

@Pablete1234
Copy link
Member

The regression is caused by 5cd0197,

5cd0197#diff-7a44dedefcea2791290af6b24d7cc76eb9dff89f21bff531b56551ad57e35ecaR98
The non-null check will always be false on non-team-based maps (ffa). This was done to fix not being able to /team force players into the match, easiest fix is to simply change (tmm != null && !tmm.isForced(player)) with (tmm == null || !tmm.isForced(player))

@Electroid Electroid added the bug Something isn't working label Feb 3, 2022
@Electroid
Copy link
Member

Mind taking a look @applenick?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

5 participants