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

console_cmd: prevent teleporting to consumed crystals #1523

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,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