Skip to content

Commit 3fd64fe

Browse files
committed
fix out of slots error
1 parent c043291 commit 3fd64fe

19 files changed

Lines changed: 251 additions & 55 deletions

TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
bugs
22
----
3-
too many items on one tile
43

54
todo
65
----

src/level_alive_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,10 @@
536536
return level_alive(g, v, l, is_level_curr, p);
537537
}
538538

539-
[[nodiscard]] auto level_alive_is_unused47(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp
539+
[[nodiscard]] auto level_alive_is_critical_to_level(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp
540540
{
541541
TRACE_DEBUG();
542-
return level_alive(g, v, l, is_unused47, p);
542+
return level_alive(g, v, l, is_critical_to_level, p);
543543
}
544544

545545
[[nodiscard]] auto level_alive_is_level_final_icon(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp

src/level_count_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,10 @@
537537
return level_count(g, v, l, is_level_curr, p);
538538
}
539539

540-
[[nodiscard]] auto level_count_is_unused47(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t
540+
[[nodiscard]] auto level_count_is_critical_to_level(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t
541541
{
542542
TRACE_DEBUG();
543-
return level_count(g, v, l, is_unused47, p);
543+
return level_count(g, v, l, is_critical_to_level, p);
544544
}
545545

546546
[[nodiscard]] auto level_count_is_level_final_icon(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t

src/level_flag_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,10 @@
536536
return level_flag(g, v, l, is_level_curr, p, me);
537537
}
538538

539-
[[nodiscard]] auto level_is_unused47(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me) -> Thingp
539+
[[nodiscard]] auto level_is_critical_to_level(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me) -> Thingp
540540
{
541541
TRACE_DEBUG();
542-
return level_flag(g, v, l, is_unused47, p, me);
542+
return level_flag(g, v, l, is_critical_to_level, p, me);
543543
}
544544

545545
[[nodiscard]] auto level_is_level_final_icon(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me) -> Thingp

src/level_flag_api_cached.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,10 @@
536536
return level_flag_cached(g, v, l, is_level_curr, p);
537537
}
538538

539-
[[nodiscard]] auto level_is_unused47_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool
539+
[[nodiscard]] auto level_is_critical_to_level_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool
540540
{
541541
TRACE_DEBUG();
542-
return level_flag_cached(g, v, l, is_unused47, p);
542+
return level_flag_cached(g, v, l, is_critical_to_level, p);
543543
}
544544

545545
[[nodiscard]] auto level_is_level_final_icon_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool

src/level_open_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,10 @@
536536
return level_open(g, v, l, is_level_curr, p);
537537
}
538538

539-
[[nodiscard]] auto level_open_is_unused47(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp
539+
[[nodiscard]] auto level_open_is_critical_to_level(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp
540540
{
541541
TRACE_DEBUG();
542-
return level_open(g, v, l, is_unused47, p);
542+
return level_open(g, v, l, is_critical_to_level, p);
543543
}
544544

545545
[[nodiscard]] auto level_open_is_level_final_icon(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp

src/my_level.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ void level_fov(const FovContext & /*ctx*/);
10771077
[[nodiscard]] auto level_is_unused3(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me = nullptr) -> Thingp;
10781078
[[nodiscard]] auto level_is_unused4(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me = nullptr) -> Thingp;
10791079
[[nodiscard]] auto level_is_unused46(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me = nullptr) -> Thingp;
1080-
[[nodiscard]] auto level_is_unused47(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me = nullptr) -> Thingp;
1080+
[[nodiscard]] auto level_is_critical_to_level(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me = nullptr) -> Thingp;
10811081
[[nodiscard]] auto level_is_unused5(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me = nullptr) -> Thingp;
10821082
[[nodiscard]] auto level_is_unused6(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me = nullptr) -> Thingp;
10831083
[[nodiscard]] auto level_is_unused63(Gamep g, Levelsp v, Levelp l, const bpoint &p, Thingp me = nullptr) -> Thingp;
@@ -1298,7 +1298,7 @@ void level_fov(const FovContext & /*ctx*/);
12981298
[[nodiscard]] auto level_is_unused3_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool;
12991299
[[nodiscard]] auto level_is_unused4_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool;
13001300
[[nodiscard]] auto level_is_unused46_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool;
1301-
[[nodiscard]] auto level_is_unused47_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool;
1301+
[[nodiscard]] auto level_is_critical_to_level_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool;
13021302
[[nodiscard]] auto level_is_unused5_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool;
13031303
[[nodiscard]] auto level_is_unused6_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool;
13041304
[[nodiscard]] auto level_is_unused63_cached(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> bool;
@@ -1517,7 +1517,7 @@ void level_fov(const FovContext & /*ctx*/);
15171517
[[nodiscard]] auto level_alive_is_unused3(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
15181518
[[nodiscard]] auto level_alive_is_unused4(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
15191519
[[nodiscard]] auto level_alive_is_unused46(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
1520-
[[nodiscard]] auto level_alive_is_unused47(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
1520+
[[nodiscard]] auto level_alive_is_critical_to_level(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
15211521
[[nodiscard]] auto level_alive_is_unused5(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
15221522
[[nodiscard]] auto level_alive_is_unused6(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
15231523
[[nodiscard]] auto level_alive_is_unused63(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
@@ -1736,7 +1736,7 @@ void level_fov(const FovContext & /*ctx*/);
17361736
[[nodiscard]] auto level_count_is_unused3(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t;
17371737
[[nodiscard]] auto level_count_is_unused4(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t;
17381738
[[nodiscard]] auto level_count_is_unused46(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t;
1739-
[[nodiscard]] auto level_count_is_unused47(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t;
1739+
[[nodiscard]] auto level_count_is_critical_to_level(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t;
17401740
[[nodiscard]] auto level_count_is_unused5(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t;
17411741
[[nodiscard]] auto level_count_is_unused6(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t;
17421742
[[nodiscard]] auto level_count_is_unused63(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> uint32_t;
@@ -1962,7 +1962,7 @@ void level_fov(const FovContext & /*ctx*/);
19621962
[[nodiscard]] auto level_open_is_unused3(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
19631963
[[nodiscard]] auto level_open_is_unused4(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
19641964
[[nodiscard]] auto level_open_is_unused46(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
1965-
[[nodiscard]] auto level_open_is_unused47(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
1965+
[[nodiscard]] auto level_open_is_critical_to_level(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
19661966
[[nodiscard]] auto level_open_is_unused5(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
19671967
[[nodiscard]] auto level_open_is_unused6(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;
19681968
[[nodiscard]] auto level_open_is_unused63(Gamep g, Levelsp v, Levelp l, const bpoint &p) -> Thingp;

src/my_thing.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ using Thing = struct Thing {
859859
[[nodiscard]] auto thing_is_unused3(Thingp t) -> bool;
860860
[[nodiscard]] auto thing_is_unused4(Thingp t) -> bool;
861861
[[nodiscard]] auto thing_is_unused46(Thingp t) -> bool;
862-
[[nodiscard]] auto thing_is_unused47(Thingp t) -> bool;
862+
[[nodiscard]] auto thing_is_critical_to_level(Thingp t) -> bool;
863863
[[nodiscard]] auto thing_is_unused5(Thingp t) -> bool;
864864
[[nodiscard]] auto thing_is_unused6(Thingp t) -> bool;
865865
[[nodiscard]] auto thing_is_unused63(Thingp t) -> bool;

src/my_tp.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
list_macro(is_unused3, "is_unused3"), /* newline */ \
218218
list_macro(is_unused4, "is_unused4"), /* newline */ \
219219
list_macro(is_unused46, "is_unused46"), /* newline */ \
220-
list_macro(is_unused47, "is_unused47"), /* newline */ \
220+
list_macro(is_critical_to_level, "is_critical_to_level"), /* newline */ \
221221
list_macro(is_unused5, "is_unused5"), /* newline */ \
222222
list_macro(is_unused6, "is_unused6"), /* newline */ \
223223
list_macro(is_unused63, "is_unused63"), /* newline */ \
@@ -716,7 +716,7 @@ class Tp;
716716
[[nodiscard]] auto tp_is_unused3(Tpp tp) -> bool;
717717
[[nodiscard]] auto tp_is_unused4(Tpp tp) -> bool;
718718
[[nodiscard]] auto tp_is_unused46(Tpp tp) -> bool;
719-
[[nodiscard]] auto tp_is_unused47(Tpp tp) -> bool;
719+
[[nodiscard]] auto tp_is_critical_to_level(Tpp tp) -> bool;
720720
[[nodiscard]] auto tp_is_unused5(Tpp tp) -> bool;
721721
[[nodiscard]] auto tp_is_unused6(Tpp tp) -> bool;
722722
[[nodiscard]] auto tp_is_unused63(Tpp tp) -> bool;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
// No need to test all slots for level select. Additionally, we've filled
4747
// all the other levels, so not a lot of space to alloc IDs from.
4848
//
49-
auto slot_depth_to_test = static_cast< int >(MAP_SLOTS);
49+
auto slot_depth_to_test = static_cast< int >(MAP_SLOTS - 1);
5050
if (level_num == LEVEL_SELECT_ID) {
5151
//
5252
// There's just no space in other levels if we fully allocate them!

0 commit comments

Comments
 (0)