Fix issue #3: Worker costs too high (double-charging)#8
Merged
TheCodingDad-TisonK merged 2 commits intomainfrom Feb 27, 2026
Merged
Fix issue #3: Worker costs too high (double-charging)#8TheCodingDad-TisonK merged 2 commits intomainfrom
TheCodingDad-TisonK merged 2 commits intomainfrom
Conversation
…uble-charging Issue #3: Worker costs too high - fixed 25€ fee being charged The mod was charging workers in addition to the game's built-in worker payment system, causing a ~25€ fixed fee (the game's default) PLUS the expected wage from the mod. This fix: 1. Hooks into mission:addMoney to intercept and skip the game's built-in worker payments when our mod is enabled 2. Uses a flag (_isProcessingPayment) to allow our mod's payments through while blocking the game's payments 3. Only affects negative money amounts (deductions) when mod is enabled Also updated version to 1.0.0.8 across all files.
…s through - Changed hook to return nil (no value) when skipping game's built-in payments - This fixes the bug where money was not being charged at all - The flag _isProcessingPayment now correctly allows our mod's payments through
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes issue #3 where worker costs were much higher than expected due to double-charging.
Root Cause
The mod was charging workers in addition to the game's built-in worker payment system. This caused:
Solution
Hooks into mission:addMoney to intercept and skip the game's built-in worker payments when the mod is enabled. Uses a flag to allow the mod's own payments through while blocking the game's payments.
Changes
Testing
Users should see worker costs matching their configured rate (e.g., /h) instead of the previous ~25€ + expected wage.