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

Miscellaneous fixes #1129

Merged
merged 4 commits into from
Aug 20, 2021
Merged

Miscellaneous fixes #1129

merged 4 commits into from
Aug 20, 2021

Conversation

hemberger
Copy link
Member

Identified by errors collected after the engine update for Game 142.

This was a result of the `$unvisitedSectors` array being empty, which
caused the SQL query to use a `AND sector_id NOT IN ()` clause. This
clause is now omitted if the array is empty.

I suspect that this worked in the past due to the escaping mechanism
in `escapeArray`, likely resulting in `AND sector_id NOT IN ('')`
(see the `$autoQuotes` option, which was removed in 3b996d9).
Use `IFloor` instead of `floor` to compute the amount of each hardware
to buy so that we have an int instead of a float. Fixes:

> TypeError: doUNO(): Argument #2 ($amount) must be of type int, float given
The logic for deciding to buy hardware has been significantly
simplified.
In the `displayGrouped` and `displayMessage` functions, we now return
the constructed message (an array) instead of passing in the message
box by reference and appending to it inside the functions.

This fixes an issue with scout messages where the "GroupedMessages"
element did not yet exist, but we were passing it by reference to the
`displayMessage` function as if it were an array. This caused the
following error:

> TypeError: displayMessage(): Argument #1 ($messageBox) must be of type array, null given
@codecov
Copy link

codecov bot commented Aug 20, 2021

Codecov Report

Merging #1129 (98f8816) into main (4b39968) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #1129   +/-   ##
=========================================
  Coverage     13.82%   13.82%           
  Complexity     3955     3955           
=========================================
  Files            85       85           
  Lines         11692    11692           
=========================================
  Hits           1616     1616           
  Misses        10076    10076           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b39968...98f8816. Read the comment docs.

@hemberger hemberger merged commit bd440ad into smrealms:main Aug 20, 2021
@hemberger hemberger deleted the misc-fixes branch August 20, 2021 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant