Skip to content

Commit

Permalink
Maximum creature types increased to 128 (#3442)
Browse files Browse the repository at this point in the history
Also fixed two recent build warnings

---------

Co-authored-by: Loobinex <[email protected]>
  • Loading branch information
benlp91 and Loobinex authored Sep 10, 2024
1 parent c986a62 commit c838e59
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/creature_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/creature_states.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/creature_states_prisn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/thing_creature.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
4 changes: 1 addition & 3 deletions src/thing_creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c838e59

Please sign in to comment.