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

Commits on Aug 20, 2021

  1. Fix bug sharing maps when all sectors are explored

    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).
    hemberger committed Aug 20, 2021
    Configuration menu
    Copy the full SHA
    69491b9 View commit details
    Browse the repository at this point in the history
  2. npc.php: fix error buying hardware

    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
    hemberger committed Aug 20, 2021
    Configuration menu
    Copy the full SHA
    461ed5b View commit details
    Browse the repository at this point in the history
  3. npc.php: clean up canWeUNO function

    The logic for deciding to buy hardware has been significantly
    simplified.
    hemberger committed Aug 20, 2021
    Configuration menu
    Copy the full SHA
    9815538 View commit details
    Browse the repository at this point in the history
  4. Fix error displaying scout messages

    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
    hemberger committed Aug 20, 2021
    Configuration menu
    Copy the full SHA
    98f8816 View commit details
    Browse the repository at this point in the history