Skip to content

Attempting to Access Crewman Menu When No Crewman in Hospital Causes Game Crash #32

@cnelso00

Description

@cnelso00

I have a "fail silently" fix that I can PR if desired. It just adds a try-catch block around the offending code, in case of an IndexError.

The text of the error is here:

/Users/<username>/code/armcom2/armcom2.py:2445: DeprecationWarning: Call the `con.print_` method instead.
  libtcod.console_print(calendar_main_panel, 2, y, 'No crewmen currently in hospital')
Traceback (most recent call last):
  File "/Users/<username>/code/armcom2/armcom2.py", line 18246, in <module>
    campaign.DoCampaignCalendarLoop()
  File "/Users/<username>/code/armcom2/armcom2.py", line 2857, in DoCampaignCalendarLoop
    crewman = campaign.hospital[selected_hospital_crewman]
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions