Increase maximum # of Followers

Surprisingly easy as it requires negative values to mark "None", so it was already out of the range of UINT8
This commit is contained in:
toaster 2023-06-28 16:36:36 +01:00
parent 4344221252
commit 1429a91cd9
4 changed files with 16 additions and 5 deletions

View file

@ -3602,7 +3602,7 @@ void readfollower(MYFILE *f)
INT32 res; INT32 res;
INT32 i; INT32 i;
if (numfollowers >= MAXSKINS) if (numfollowers >= MAXFOLLOWERS)
{ {
I_Error("Out of Followers\nLoad less addons to fix this."); I_Error("Out of Followers\nLoad less addons to fix this.");
} }

View file

@ -14,7 +14,7 @@
#include "m_cond.h" #include "m_cond.h"
INT32 numfollowers = 0; INT32 numfollowers = 0;
follower_t followers[MAXSKINS]; follower_t followers[MAXFOLLOWERS];
INT32 numfollowercategories; INT32 numfollowercategories;
followercategory_t followercategories[MAXFOLLOWERCATEGORIES]; followercategory_t followercategories[MAXFOLLOWERCATEGORIES];

View file

@ -20,6 +20,13 @@
extern "C" { extern "C" {
#endif #endif
// The important collorary to "Hornmod is universally hated in dev" is
// the simple phrase "this is why" -- 1024 is obscene yet will fill up.
// By the way, this comment will grow stronger and stronger every time
// somebody comes here to double it, so I encourage you to leave a new
// (dated) comment every time you do so. ~toast 280623
#define MAXFOLLOWERS 1024
#define FOLLOWERCOLOR_MATCH UINT16_MAX #define FOLLOWERCOLOR_MATCH UINT16_MAX
#define FOLLOWERCOLOR_OPPOSITE (UINT16_MAX-1) #define FOLLOWERCOLOR_OPPOSITE (UINT16_MAX-1)
@ -85,12 +92,14 @@ struct follower_t
statenum_t losestate; // state when the player has lost statenum_t losestate; // state when the player has lost
statenum_t hitconfirmstate; // state for hit confirm statenum_t hitconfirmstate; // state for hit confirm
tic_t hitconfirmtime; // time to keep the above playing for tic_t hitconfirmtime; // time to keep the above playing for
sfxenum_t hornsound; // Press (B) to announce you are pressing (B)
}; };
extern INT32 numfollowers; extern INT32 numfollowers;
extern follower_t followers[MAXSKINS]; extern follower_t followers[MAXFOLLOWERS];
#define MAXFOLLOWERCATEGORIES 32 #define MAXFOLLOWERCATEGORIES 64
struct followercategory_t struct followercategory_t
{ {

View file

@ -2649,7 +2649,9 @@ void K_TryHurtSoundExchange(mobj_t *victim, mobj_t *attacker)
attacker->player->confirmVictim = (victim->player - players); attacker->player->confirmVictim = (victim->player - players);
attacker->player->confirmVictimDelay = TICRATE/2; attacker->player->confirmVictimDelay = TICRATE/2;
if (attacker->player->follower != NULL) if (attacker->player->follower != NULL
&& attacker->player->followerskin >= 0
&& attacker->player->followerskin < numfollowers)
{ {
const follower_t *fl = &followers[attacker->player->followerskin]; const follower_t *fl = &followers[attacker->player->followerskin];
attacker->player->follower->movecount = fl->hitconfirmtime; // movecount is used to play the hitconfirm animation for followers. attacker->player->follower->movecount = fl->hitconfirmtime; // movecount is used to play the hitconfirm animation for followers.