0 of 0

File information

Last updated

Original upload

Created by

Simplexity

Uploaded by

RhythmicSystem

Virus scan

Safe to use

Tags for this mod

About this mod

A workaround for the 'divide by zero error' that can cause the game to hang after leaving a moon

Requirements
Permissions and credits
Fix XP Divide By Zero Error

The Problem

During our modding and gameplay throughout Lethal Company, we regularly suffered from issues like desync and the game just outright hanging and stopping.

While we are not convinced that the XP Divide By Zero error necessarily caused desync, there were a few things that were odd...

  • The host would hear a "clicking" sound (we later found out it was the XP Bar increase sound).
      - This indicated to the host that there was desync.  - Sometimes we could still leave the planet and the game would save.
  •  Sometimes, when leaving the planet, it would go through all the motions but fail right before saving.
      - We later found out that it was because of the Divide By Zero error.

The Workaround

The code divides by "XPMax" which, for whatever reason during something in our games, would get set to 0.
This mod simply goes to the HUDManager and before doing SetPlayerLevel, sets XPMax to 1 if it is 0.
I do not know if this mod is necessary when you are not the host.

The Result


- The game no longer will hang when it usually did (tested on a save file we kept where the problem was).
I do not know what mods or corruption or whatever could have happened to cause XPMax to be set to 0.

Note:
If you're able to figure out which mods are causing the issue, you should let the developer of that mod know. This is a band-aid solution to allow the game to be playable, but does not solve the actual issue. Please tell developers when you encounter these issues before using workarounds.

Reporting Bugs:
If you have any bugs with this mod to report, please report them on GitHub: https://github.com/Simplexity-Development/LC_FixXpDbzError/issues