From c838e59e72e94f6552b0105c56286d7c1e069842 Mon Sep 17 00:00:00 2001 From: benlp91 <137918874+benlp91@users.noreply.github.com> Date: Wed, 11 Sep 2024 00:18:36 +0200 Subject: [PATCH] Maximum creature types increased to 128 (#3442) Also fixed two recent build warnings --------- Co-authored-by: Loobinex --- src/creature_control.h | 6 ++++-- src/creature_states.c | 2 +- src/creature_states_prisn.c | 2 +- src/thing_creature.c | 2 +- src/thing_creature.h | 4 +--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/creature_control.h b/src/creature_control.h index 7aa0d08234..9d5080dfc9 100644 --- a/src/creature_control.h +++ b/src/creature_control.h @@ -32,8 +32,8 @@ extern "C" { #endif -#define CREATURE_TYPES_MAX 64 -#define SWAP_CREATURE_TYPES_MAX 64 +#define CREATURE_TYPES_MAX 128 +#define SWAP_CREATURE_TYPES_MAX 128 #define CREATURE_STATES_MAX 256 #define MAX_SIZEXY 768 @@ -559,6 +559,8 @@ struct CreatureSounds { struct CreatureSound fight; }; +extern int creature_swap_idx[CREATURE_TYPES_MAX]; + #pragma pack() /******************************************************************************/ struct CreatureControl *creature_control_get(long cctrl_idx); diff --git a/src/creature_states.c b/src/creature_states.c index cdf1516916..dcb67506b3 100644 --- a/src/creature_states.c +++ b/src/creature_states.c @@ -5210,7 +5210,7 @@ void process_person_moods_and_needs(struct Thing *thing) } if (creature_is_leaving_and_cannot_be_stopped(thing)) { - return false; + return; } struct CreatureStats* crstat = creature_stats_get_from_thing(thing); // Now process the needs diff --git a/src/creature_states_prisn.c b/src/creature_states_prisn.c index 0e72b63592..612ad53bc2 100644 --- a/src/creature_states_prisn.c +++ b/src/creature_states_prisn.c @@ -334,7 +334,7 @@ TbBool prison_convert_creature_to_skeleton(struct Room *room, struct Thing *thin } else { - WARNLOG("Could not create creature %s to transform %s to due to creature limit", thing_model_name(crmodel),thing_model_name(thing)); + WARNLOG("Could not create creature %s to transform %s to due to creature limit", creature_code_name(crmodel),thing_model_name(thing)); } if (creature_model_bleeds(thing->model)) create_effect_around_thing(thing, TngEff_Blood5); diff --git a/src/thing_creature.c b/src/thing_creature.c index 6b1b5a9a25..05d926bedb 100644 --- a/src/thing_creature.c +++ b/src/thing_creature.c @@ -101,7 +101,7 @@ extern "C" { #endif /******************************************************************************/ -int creature_swap_idx[CREATURE_TYPES_COUNT]; +int creature_swap_idx[CREATURE_TYPES_MAX]; /******************************************************************************/ extern struct TbLoadFiles swipe_load_file[]; diff --git a/src/thing_creature.h b/src/thing_creature.h index 8fcd42d413..bc79def6b7 100644 --- a/src/thing_creature.h +++ b/src/thing_creature.h @@ -31,8 +31,7 @@ extern "C" { #endif /******************************************************************************/ -#define CREATURE_TYPES_COUNT 32 -#define DEAD_CREATURES_MAX_COUNT 64 +#define DEAD_CREATURES_MAX_COUNT 128 #define CREATURE_NAME_MAX 25 /** The standard altitude at which a creature is flying. * Should be over one tile, to allow flying creatures leave water areas. */ @@ -78,7 +77,6 @@ struct CreatureStorage { /******************************************************************************/ extern struct TbSprite *swipe_sprites; extern struct TbSprite *end_swipe_sprites; -extern int creature_swap_idx[CREATURE_TYPES_COUNT]; extern unsigned long creature_create_errors; /******************************************************************************/ struct Thing *create_creature(struct Coord3d *pos, ThingModel model, PlayerNumber owner);