- removed a few redundant one-liner functions.

This commit is contained in:
Christoph Oelckers 2021-08-30 22:27:25 +02:00
parent d7078dda48
commit d6724185b3
5 changed files with 9 additions and 43 deletions

View File

@ -58,11 +58,6 @@ void GameInterface::LevelCompleted(MapRecord *map, int skill)
}
CKillMgr::CKillMgr()
{
Clear();
}
void CKillMgr::SetCount(int nCount)
{
TotalKills = nCount;
@ -99,11 +94,6 @@ void CKillMgr::Clear(void)
TotalKills = Kills = 0;
}
CSecretMgr::CSecretMgr(void)
{
Clear();
}
void CSecretMgr::SetCount(int nCount)
{
Total = nCount;
@ -117,10 +107,6 @@ void CSecretMgr::Found(int nType)
return;
}
else Super++;
if (gGameOptions.nGameType == 0) {
viewSetMessage(GStrings(FStringf("TXTB_SECRET%d", Random(2))), 0, MESSAGE_PRIORITY_SECRET);
}
}
void CSecretMgr::Clear(void)

View File

@ -29,7 +29,6 @@ BEGIN_BLD_NS
class CKillMgr {
public:
int TotalKills, Kills;
CKillMgr();
void SetCount(int);
void AddNewKill(int);
void AddKill(spritetype *pSprite);
@ -40,7 +39,6 @@ public:
class CSecretMgr {
public:
int Total, Founds, Super;
CSecretMgr();
void SetCount(int);
void Found(int);
void Clear(void);

View File

@ -391,13 +391,20 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command)
return;
#endif
case kChannelSetTotalSecrets:
if (command >= kCmdNumberic) levelSetupSecret(command - kCmdNumberic);
if (command >= kCmdNumberic) gSecretMgr.SetCount(command - kCmdNumberic);
else viewSetSystemMessage("Invalid Total-Secrets command by xobject #%d (object type %d)", nIndex, nType);
break;
case kChannelSecretFound:
if (SECRET_Trigger(nIndex + 65536 * nType)) // if the hint system knows this secret it's a retrigger - skip that.
{
if (command >= kCmdNumberic) levelTriggerSecret(command - kCmdNumberic);
if (command >= kCmdNumberic)
{
gSecretMgr.Found(command - kCmdNumberic);
if (gGameOptions.nGameType == 0)
{
viewSetMessage(GStrings(FStringf("TXTB_SECRET%d", Random(2))), 0, MESSAGE_PRIORITY_SECRET);
}
}
else viewSetSystemMessage("Invalid Trigger-Secret command by xobject #%d (object type %d)", nIndex, nType);
}
break;

View File

@ -54,28 +54,6 @@ void levelInitINI(const char *pzIni)
strncpy(BloodIniFile, pzIni, BMAX_PATH);
}
void levelOverrideINI(const char *pzIni)
{
bINIOverride = true;
strcpy(BloodIniFile, pzIni);
}
void levelClearSecrets(void)
{
gSecretMgr.Clear();
}
void levelSetupSecret(int nCount)
{
gSecretMgr.SetCount(nCount);
}
void levelTriggerSecret(int nSecret)
{
gSecretMgr.Found(nSecret);
}
void CheckSectionAbend(const char *pzSection)
{
if (!pzSection || !BloodINI->SectionExists(pzSection))

View File

@ -75,9 +75,6 @@ extern MapRecord* gNextLevel;
extern bool gGameStarted;
void levelInitINI(const char *pzIni);
void levelOverrideINI(const char *pzIni);
void levelSetupSecret(int nCount);
void levelTriggerSecret(int nSecret);
void CheckSectionAbend(const char *pzSection);
void CheckKeyAbend(const char *pzSection, const char *pzKey);
void levelLoadDefaults(void);