Author Topic: Interlude Problems with events  (Read 94 times)

Online phanie

  • Vassal
  • *
  • Posts: 6
Problems with events
« on: July 31, 2020, 12:11:54 AM »
I have a problem with the TVT, CTF and DM events. I put a value for min players in the db, but it doesn't work. Events start even when no one registers.

Online phanie

  • Vassal
  • *
  • Posts: 6
Re: Problems with events
« Reply #1 on: July 31, 2020, 01:35:34 PM »
I discovered the problem. The condition of checkMaxPlayers and checkMinPlayers are reversed.

Online Mobius

  • Administrator
  • Distinguished King
  • *****
  • Posts: 7479
Re: Problems with events
« Reply #2 on: July 31, 2020, 02:52:11 PM »
Thank you for sharing this.
How should the values be?
Can you make a patch for it?
;D

Online G-hamsteR

  • Knight
  • ***
  • Posts: 71
Re: Problems with events
« Reply #3 on: August 02, 2020, 01:42:55 PM »
Unfortunatelly I can't test it, but checking the code these functions have the reverse outcome. Here is a fix for TvT:

Code: [Select]
diff --git java/org/l2jmobius/gameserver/model/entity/event/TvT.java java/org/l2jmobius/gameserver/model/entity/event/TvT.java
index c209430..508ee36 100644
--- java/org/l2jmobius/gameserver/model/entity/event/TvT.java
+++ java/org/l2jmobius/gameserver/model/entity/event/TvT.java
@@ -537,7 +537,7 @@
  */
  public static boolean checkMinPlayers(int players)
  {
- return _minPlayers > players;
+ return _minPlayers <= players;
  }
 
  /**
@@ -547,7 +547,7 @@
  */
  public static boolean checkMaxPlayers(int players)
  {
- return _maxPlayers <= players;
+ return _maxPlayers > players;
  }
 
  /**

If someone can test it, the same applies to other events.