Skip to content

Commit

Permalink
console_cmd: prevent teleporting to consumed crystals (#1523)
Browse files Browse the repository at this point in the history
Resolves #1518.
  • Loading branch information
lahm86 authored Sep 15, 2024
1 parent a5b2fb9 commit 28f256c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- fixed `/kill` console command not fully killing enemies (#1482, regression from 3.0)
- fixed `/tp` console command not always picking the closest item (#1486, regression from 4.1)
- fixed `/tp` console command reporting teleport fails as success (#1484, regression from 4.1)
- fixed `/tp` console command allowing teleporting to consumed savegame crystals (#1518)
- fixed `/set` console command not sanitizing numeric values (#1515)
- fixed console commands causing improper ring shutdown with selected inventory item (#1460, regression from 3.0)
- fixed console input immediately ending demo (#1480, regression from 4.1)
Expand Down
7 changes: 4 additions & 3 deletions src/game/console_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ static COMMAND_RESULT Console_Cmd_Teleport(const char *const args)
for (int16_t item_num = 0; item_num < Item_GetTotalCount();
item_num++) {
const ITEM_INFO *const item = &g_Items[item_num];
const bool is_pickup =
Object_IsObjectType(item->object_id, g_PickupObjects);
if (is_pickup
const bool is_consumable =
Object_IsObjectType(item->object_id, g_PickupObjects)
|| item->object_id == O_SAVEGAME_ITEM;
if (is_consumable
&& (item->status == IS_INVISIBLE
|| item->status == IS_DEACTIVATED)) {
continue;
Expand Down

0 comments on commit 28f256c

Please sign in to comment.