Skip to content

Commit

Permalink
fix the unordered_map not being correctly readable from lua, update…
Browse files Browse the repository at this point in the history
… doc
  • Loading branch information
Mr-Auto committed Dec 14, 2024
1 parent 55bba79 commit 8518c50
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/game_data/spel2.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/src/includes/_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ Type | Name | Description
int | [background_sprite_id](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=background_sprite_id) |
bool | [killed_by_NA](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=killed_by_NA) |
bool | [defeated_NA](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=defeated_NA) |
[TEXTURE](#TEXTURE) | [portret_texture](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=portret_texture) |
[TEXTURE](#TEXTURE) | [portrait_texture](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=portrait_texture) |

### JournalTrapData

Expand Down Expand Up @@ -2128,7 +2128,7 @@ map<[ENT_TYPE](#ENT_TYPE), [JournalPageData](#JournalPageData)> | [item_in
map<[ENT_TYPE](#ENT_TYPE), [JournalPageData](#JournalPageData)> | [trap_info](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trap_info) |
map<[ENT_TYPE](#ENT_TYPE), [ENT_TYPE](#ENT_TYPE)> | [trap_part_to_main](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trap_part_to_main) | used for stuff like upsidedown_spikes -> spikes, skulldrop skulls -> skulldrop trap etc.
map<[ENT_TYPE](#ENT_TYPE), [StickersData](#StickersData)> | [stickers_data](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=stickers_data) |
[SaveData](#SaveData) | [get_SaveData()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_SaveData) | Gets local version of the [SaveData](#SaveData)
[SaveData](#SaveData) | [get_savegame()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_savegame) | Gets local version of the [SaveData](#SaveData)

### Screen

Expand Down
19 changes: 10 additions & 9 deletions src/game_api/game_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "aliases.hpp" // for MAX_PLAYERS
#include "containers/game_unordered_map.hpp" // for game_unordered_map
#include "containers/identity_hasher.hpp" // for identity_hasher
#include "render_api.hpp" // for TextureRenderingInfo
#include "sound_manager.hpp" // for BackgroundSound
#include "thread_utils.hpp" // for OnHeapPointer
Expand Down Expand Up @@ -95,18 +96,18 @@ struct SaveRelated
ENT_TYPE progress_stickers_powerups[29]; // pre-journal progress setup, maybe gathering from all players or something?

/// Scale and offset not used in those pages. Can't add more
game_unordered_map<uint8_t, JournalPageData> places_data;
game_unordered_map<ENT_TYPE, JournalBestiaryData> bestiary_data;
game_unordered_map<uint8_t, JournalPageData, identity_hasher<>> places_data;
game_unordered_map<ENT_TYPE, JournalBestiaryData, identity_hasher<>> bestiary_data;
/// used to map stuff like Osiris_Hand -> Osiris_Head, Hundun limbs -> Hundun etc.
game_unordered_map<ENT_TYPE, ENT_TYPE> monster_part_to_main;
game_unordered_map<ENT_TYPE, JournalPeopleData> people_info;
game_unordered_map<ENT_TYPE, ENT_TYPE, identity_hasher<>> monster_part_to_main;
game_unordered_map<ENT_TYPE, JournalPeopleData, identity_hasher<>> people_info;
/// used to map shopkeeper clone to shopkeeper only
game_unordered_map<ENT_TYPE, ENT_TYPE> people_part_to_main;
game_unordered_map<ENT_TYPE, JournalPageData> item_info;
game_unordered_map<ENT_TYPE, JournalPageData> trap_info;
game_unordered_map<ENT_TYPE, ENT_TYPE, identity_hasher<>> people_part_to_main;
game_unordered_map<ENT_TYPE, JournalPageData, identity_hasher<>> item_info;
game_unordered_map<ENT_TYPE, JournalPageData, identity_hasher<>> trap_info;
/// used for stuff like upsidedown_spikes -> spikes, skulldrop skulls -> skulldrop trap etc.
game_unordered_map<ENT_TYPE, ENT_TYPE> trap_part_to_main;
game_unordered_map<ENT_TYPE, StickersData> stickers_data;
game_unordered_map<ENT_TYPE, ENT_TYPE, identity_hasher<>> trap_part_to_main;
game_unordered_map<ENT_TYPE, StickersData, identity_hasher<>> stickers_data;

/// Gets local version of the SaveData
SaveData* get_savegame()
Expand Down

0 comments on commit 8518c50

Please sign in to comment.