Skip to content

Commit

Permalink
remove println
Browse files Browse the repository at this point in the history
  • Loading branch information
wootguy committed Nov 4, 2024
1 parent 4e2a9ba commit a5018f9
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 24 deletions.
12 changes: 6 additions & 6 deletions dlls/TextMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ void TextMenu::handleMenuMessage(int msg_dest, edict_t* ed) {
}

if ((msg_dest == MSG_ONE || msg_dest == MSG_ONE_UNRELIABLE) && ed) {
//println("New menu opened for %s", STRING(ed->v.netname));
//ALERT(at_console, "New menu opened for %s", STRING(ed->v.netname));
viewers &= ~(PLRBIT(ed));
}
else if (msg_dest == MSG_ALL || msg_dest == MSG_ALL) {
//println("New menu opened for all players");
//ALERT(at_console, "New menu opened for all players");
viewers = 0;
}
else {
//println("Unhandled text menu message dest: %d", msg_dest);
//ALERT(at_console, "Unhandled text menu message dest: %d", msg_dest);
}
}

Expand Down Expand Up @@ -137,7 +137,7 @@ void TextMenu::handleMenuselectCmd(edict_t* pEntity, int selection) {
}
}
else {
//println("%s is not viewing the '%s' menu", STRING(pEntity->v.netname), title.c_str());
//ALERT(at_console, "%s is not viewing the '%s' menu", STRING(pEntity->v.netname), title.c_str());
}
}

Expand All @@ -151,7 +151,7 @@ void TextMenu::SetTitle(std::string newTitle) {

void TextMenu::AddItem(std::string displayText, std::string optionData) {
if (numOptions >= MAX_MENU_OPTIONS) {
println("Maximum menu options reached! Failed to add: %s", optionData.c_str());
ALERT(at_console, "Maximum menu options reached! Failed to add: %s", optionData.c_str());
return;
}

Expand Down Expand Up @@ -217,7 +217,7 @@ void TextMenu::Open(uint8_t duration, uint8_t page, edict_t* player) {
viewers |= PLRBIT(player);
}
else {
println("WARNING: pagination is broken for menus that don't have a destination player");
ALERT(at_console, "WARNING: pagination is broken for menus that don't have a destination player");
MESSAGE_BEGIN(MSG_ALL, gmsgShowMenu);
WRITE_SHORT(validSlots);
WRITE_CHAR(duration);
Expand Down
5 changes: 1 addition & 4 deletions dlls/enginecallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,12 @@ EXPORT void DEBUG_MSG(ALERT_TYPE target, const char* format, ...);

#if defined(PLUGIN_BUILD) && defined(PLUGIN_NAME)
#define ALERT(target, fmt, ...) { \
DEBUG_MSG(target, "[" PLUGIN_NAME "] "); \
DEBUG_MSG(target, fmt, ##__VA_ARGS__); \
DEBUG_MSG(target, (std::string("[" PLUGIN_NAME "] ") + fmt).c_str(), ##__VA_ARGS__); \
}
#else
#define ALERT DEBUG_MSG
#endif

#define print(...) {ALERT(at_console, __VA_ARGS__, NULL);}
#define println(...) {ALERT(at_console, __VA_ARGS__, NULL); DEBUG_MSG(at_console, "\n", NULL);}
#define ENGINE_FPRINTF (*g_engfuncs.pfnEngineFprintf)
#define ALLOC_PRIVATE (*g_engfuncs.pfnPvAllocEntPrivateData)
inline void *GET_PRIVATE( const edict_t *pent )
Expand Down
16 changes: 8 additions & 8 deletions dlls/monster/CBaseMonster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ void CBaseMonster::SetActivity(Activity NewActivity)

#ifdef DEBUG_MONSTER
if (FClassnameIs(pev, DEBUG_MONSTER)) {
println(" SetActivity %s", activity_map[NewActivity].name);
ALERT(at_console, " SetActivity %s", activity_map[NewActivity].name);
}
#endif

Expand Down Expand Up @@ -5447,7 +5447,7 @@ void CBaseMonster::MaintainSchedule(void)
TaskBegin();
#ifdef DEBUG_MONSTER
if (FClassnameIs(pev, DEBUG_MONSTER)) {
println(" Start Task %s with data %f", GetTaskName(pTask->iTask), pTask->flData);
ALERT(at_console, " Start Task %s with data %f", GetTaskName(pTask->iTask), pTask->flData);
}
#endif
StartTask(pTask);
Expand Down Expand Up @@ -6988,24 +6988,24 @@ void CBaseMonster::ScheduleChange(void)
// debugging schedules
if (FClassnameIs(pev, DEBUG_MONSTER)) {
const char* schedName = m_pSchedule != NULL ? m_pSchedule->pName : "NULL";
println("\nSchedule changing from <%s> because:", schedName);
ALERT(at_console, "\nSchedule changing from <%s> because:", schedName);

if (m_MonsterState != m_IdealMonsterState) {
println("- monster state changing from %d to %d", m_MonsterState, m_IdealMonsterState);
ALERT(at_console, "- monster state changing from %d to %d", m_MonsterState, m_IdealMonsterState);
}
if (!FScheduleValid()) {
if (m_pSchedule == NULL) {
println("- Schedule is NULL");
ALERT(at_console, "- Schedule is NULL");
return;
}
if (HasConditions(bits_COND_SCHEDULE_DONE)) {
println("- Schedule is finished");
ALERT(at_console, "- Schedule is finished");
}
if (HasConditions(bits_COND_TASK_FAILED)) {
println("- Task failed");
ALERT(at_console, "- Task failed");
}
if (HasConditions(m_pSchedule->iInterruptMask)) {
println("- Interrupted by %d", m_pSchedule->iInterruptMask);
ALERT(at_console, "- Interrupted by %d", m_pSchedule->iInterruptMask);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/monster/CHWGrunt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ void CHWGrunt::StartTask(Task_t* pTask) {
if (pGun && MoveToLocation(m_movementActivity, 2, pGun->pev->origin))
{
TaskComplete();
println("MOVE COMPLETE!");
ALERT(at_console, "MOVE COMPLETE!");
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion dlls/monster/CTalkSquadMonster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ int CTalkSquadMonster::SquadRecruit(int searchRadius, int maxMembers)
{
CTalkSquadMonster* pRecruit = pEntity->MyTalkSquadMonsterPointer();
//if (pRecruit) {
// println("Potential squad member!");
// ALERT(at_console, "Potential squad member!");
//}

if (pRecruit && pRecruit != this && pRecruit->IsAlive() && !pRecruit->m_hCine)
Expand Down
4 changes: 2 additions & 2 deletions dlls/monster/CTor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void CTor::HandleAnimEvent(MonsterEvent_t* pEvent)
}
break;
case EVENT_SUMMON_GRUNT:
//println("SUMMON EVENT");
//ALERT(at_console, "SUMMON EVENT");
break;
case EVENT_STAFF_SWING:
case EVENT_STAFF_STAB:
Expand Down Expand Up @@ -693,7 +693,7 @@ bool CTor::GetSummonPos(Vector& pos) {

void CTor::StartSummon() {
if (!GetSummonPos(summonPos)) {
println("Failed to summon");
ALERT(at_console, "Failed to summon");
return;
}

Expand Down
4 changes: 2 additions & 2 deletions dlls/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2766,11 +2766,11 @@ std::vector<std::string> getDirFiles(std::string path, std::string extension, st
WIN32_FIND_DATA FindFileData;
HANDLE hFind;

//println("Target file is " + path);
//ALERT(at_console, "Target file is " + path);
hFind = FindFirstFile(path.c_str(), &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
//println("FindFirstFile failed " + str((int)GetLastError()) + " " + path);
//ALERT(at_console, "FindFirstFile failed " + str((int)GetLastError()) + " " + path);
return results;
}
else
Expand Down

0 comments on commit a5018f9

Please sign in to comment.