case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
}
- LOG_DEBUGF("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, this.model);
+ LOG_DEBUGF("Frame %d missing in model %s, and we have no fallback - FAIL!", f, this.model);
return f;
}
void CSQCPlayer_FallbackFrame_Apply(entity this)
// we need to prevent this from 'appening
this.tag_entity = NULL;
this.drawmask = 0;
- LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it\n");
+ LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it");
}
}
else if(this.tag_entity.isplayermodel)
}
}
if (warning)
- LOG_TRACE("Automatically fixed wrong/missing panel numbers in _hud_panelorder\n");
+ LOG_TRACE("Automatically fixed wrong/missing panel numbers in _hud_panelorder");
cvar_set("_hud_panelorder", s);
if(hud_panelorder_prev)
}
else
{
- LOG_WARNF("Unrecognized mode %s\n", mode);
+ LOG_WARNF("Unrecognized mode %s", mode);
return false;
}
// printf("^1 skipping %s\n", s);
}
if(QuickMenu_Buffer_Index == QuickMenu_Buffer_Size)
- LOG_WARNF("Couldn't find submenu \"%s\"\n", z_submenu);
+ LOG_WARNF("Couldn't find submenu \"%s\"", z_submenu);
}
// only the last page can contain up to QUICKMENU_MAXLINES entries
if(target_submenu != "" && !target_submenu_found)
{
- LOG_WARNF("Couldn't find submenu \"%s\"\n", target_submenu);
+ LOG_WARNF("Couldn't find submenu \"%s\"", target_submenu);
if(prvm_language != "en")
- LOG_WARNF("^3Warning: submenu must be in English\n", target_submenu);
+ LOG_WARNF("^3Warning: submenu must be in English", target_submenu);
QuickMenu_Buffer_Size = 0;
}
}
default:
if(GetTeam(Team, false) == NULL)
{
- LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
+ LOG_TRACEF("trying to switch to unsupported team %d", Team);
Team = NUM_SPECTATOR;
}
break;
default:
if(GetTeam(Team, false) == NULL)
{
- LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
+ LOG_TRACEF("trying to switch to unsupported team %d", Team);
Team = NUM_SPECTATOR;
}
break;
time = savetime;
if (!done)
{
- LOG_FATALF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
+ LOG_FATALF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
}
}
if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}\n", this, this.entnum, this.enttype);
if (wasfreed(this))
{
- LOG_WARN("CSQC_Ent_Remove called for already removed entity. Packet loss?\n");
+ LOG_WARN("CSQC_Ent_Remove called for already removed entity. Packet loss?");
return;
}
if (this.enttype) Ent_Remove(this);
}
}
else
- LOG_TRACE("No model parameters for ", e.model, "\n");
+ LOG_TRACE("No model parameters for ", e.model);
//dprint(e.model, " uses ", ftos(e.bone_upperbody), " ", ftos(e.fixbone), "\n");
get_model_parameters(string_null, 0);
e.skeleton_info_modelindex = e.modelindex;
if (damage_dealt_time != damage_dealt_time_prev)
{
unaccounted_damage += unaccounted_damage_new;
- LOG_TRACE("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n");
+ LOG_TRACE("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")");
}
damage_dealt_time_prev = damage_dealt_time;
pitch_shift = mirror_value + (mirror_value - pitch_shift);
}
- LOG_TRACE("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n");
+ LOG_TRACE("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift));
// todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary
// todo: normalize sound pressure levels? seems unnecessary
if (f != -1) return f;
});
#ifdef CSQC
- LOG_DEBUGF("Missing animation for %s: %s\n", modelnameforindex(mdlidx), this.registered_id);
+ LOG_DEBUGF("Missing animation for %s: %s", modelnameforindex(mdlidx), this.registered_id);
#endif
return -1;
}
string do_cvar = curl_uri_get_cvar[i];
if(status != 0)
{
- LOG_TRACEF("error: status is %d\n", status);
+ LOG_TRACEF("error: status is %d", status);
if(do_cvar)
strunzone(do_cvar);
return;
{
float f = cvar_settemp(argv(1), argv(2));
if(f == 1)
- LOG_TRACE("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
+ LOG_TRACE("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.");
else if(f == -1)
- LOG_TRACE("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
+ LOG_TRACE("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".");
// else cvar_settemp itself errors out
return;
float i = cvar_settemp_restore();
if(i)
- LOG_TRACE("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
+ LOG_TRACE("Restored ", ftos(i), " temporary cvar settings to their original values.");
else
- LOG_TRACE("Nothing to restore.\n");
+ LOG_TRACE("Nothing to restore.");
return;
}
#undef p
#undef MY
default:
- LOG_WARNF("Unknown property '%s'\n", k);
+ LOG_WARNF("Unknown property '%s'", k);
break;
}
}
LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.\n", filename);
fclose(fh);
} else {
- LOG_WARNF("Could not open file '%s'!\n", filename);
+ LOG_WARNF("Could not open file '%s'!", filename);
}
return;
}
else
{
// Can this happen?
- LOG_WARNF("Missing entcs data for player %d\n", who);
+ LOG_WARNF("Missing entcs data for player %d", who);
sound8(e, o, chan, sample, vol, atten, 0, 0);
}
return true;
else
{
// Can this happen?
- LOG_WARNF("Missing entcs data for player %d\n", who);
+ LOG_WARNF("Missing entcs data for player %d", who);
sound8(e, o, chan, sample, vol, atten, 0, 0);
}
return true;
int fh = fopen(f, FILE_READ);
if (fh < 0)
{
- LOG_WARNF("Player sound file not found: %s\n", f);
+ LOG_WARNF("Player sound file not found: %s", f);
return;
}
for (string s; (s = fgets(fh)); )
int n = tokenize_console(s);
if (n != 3)
{
- if (n != 0) LOG_WARNF("Invalid sound info line: %s\n", s);
+ if (n != 0) LOG_WARNF("Invalid sound info line: %s", s);
continue;
}
string file = argv(1);
int fh = fopen(f, FILE_READ);
if (fh < 0)
{
- if (strict) LOG_WARNF("Player sound file not found: %s\n", f);
+ if (strict) LOG_WARNF("Player sound file not found: %s", f);
return false;
}
for (string s; (s = fgets(fh)); )
int n = tokenize_console(s);
if (n != 3)
{
- if (n != 0) LOG_WARNF("Invalid sound info line: %s\n", s);
+ if (n != 0) LOG_WARNF("Invalid sound info line: %s", s);
continue;
}
string key = argv(0);
if (GetPlayerSoundSampleField_notFound) field = GetVoiceMessageSampleField(key);
if (GetPlayerSoundSampleField_notFound)
{
- LOG_TRACEF("Invalid sound info field: %s\n", key);
+ LOG_TRACEF("Invalid sound info field: %s", key);
continue;
}
string file = argv(1);
void nb_spawnteam(string teamname, float teamcolor)
{
- LOG_TRACE("^2spawned team ", teamname, "\n");
+ LOG_TRACE("^2spawned team ", teamname);
entity e = new(nexball_team);
e.netname = teamname;
e.cnt = teamcolor;
{
entity l;
// first check if the game has ended
- LOG_DEBUG("--- updatelinks ---\n");
+ LOG_DEBUG("--- updatelinks ---");
// mark generators as being shielded and networked
for(l = ons_worldgeneratorlist; l; l = l.ons_worldgeneratornext)
{
if (l.iscaptured)
- LOG_DEBUG(strcat(etos(l), " (generator) belongs to team ", ftos(l.team), "\n"));
+ LOG_DEBUG(etos(l), " (generator) belongs to team ", ftos(l.team));
else
- LOG_DEBUG(strcat(etos(l), " (generator) is destroyed\n"));
+ LOG_DEBUG(etos(l), " (generator) is destroyed");
l.islinked = l.iscaptured;
l.isshielded = l.iscaptured;
l.sprite.SendFlags |= 16;
l.isshielded = true;
int i;
for(i = 0; i < 17; ++i) { l.isgenneighbor[i] = false; l.iscpneighbor[i] = false; }
- LOG_DEBUG(strcat(etos(l), " (point) belongs to team ", ftos(l.team), "\n"));
+ LOG_DEBUG(etos(l), " (point) belongs to team ", ftos(l.team));
l.sprite.SendFlags |= 16;
}
// flow power outward from the generators through the network
{
stop = false;
l.goalentity.islinked = true;
- LOG_DEBUG(strcat(etos(l), " (link) is marking ", etos(l.goalentity), " (point) because its team matches ", etos(l.enemy), " (point)\n"));
+ LOG_DEBUG(etos(l), " (link) is marking ", etos(l.goalentity), " (point) because its team matches ", etos(l.enemy), " (point)");
}
else if (!l.enemy.islinked)
{
stop = false;
l.enemy.islinked = true;
- LOG_DEBUG(strcat(etos(l), " (link) is marking ", etos(l.enemy), " (point) because its team matches ", etos(l.goalentity), " (point)\n"));
+ LOG_DEBUG(etos(l), " (link) is marking ", etos(l.enemy), " (point) because its team matches ", etos(l.goalentity), " (point)");
}
}
}
{
if(DIFF_TEAM(l.goalentity, l.enemy))
{
- LOG_DEBUG(strcat(etos(l), " (link) is unshielding ", etos(l.enemy), " (point) because its team does not match ", etos(l.goalentity), " (point)\n"));
+ LOG_DEBUG(etos(l), " (link) is unshielding ", etos(l.enemy), " (point) because its team does not match ", etos(l.goalentity), " (point)");
l.enemy.isshielded = false;
}
if(l.goalentity.classname == "onslaught_generator")
{
if(DIFF_TEAM(l.goalentity, l.enemy))
{
- LOG_DEBUG(strcat(etos(l), " (link) is unshielding ", etos(l.goalentity), " (point) because its team does not match ", etos(l.enemy), " (point)\n"));
+ LOG_DEBUG(etos(l), " (link) is unshielding ", etos(l.goalentity), " (point) because its team does not match ", etos(l.enemy), " (point)");
l.goalentity.isshielded = false;
}
if(l.enemy.classname == "onslaught_generator")
{
if (l.isshielded)
{
- LOG_DEBUG(strcat(etos(l), " (generator) is shielded\n"));
+ LOG_DEBUG(etos(l), " (generator) is shielded");
l.takedamage = DAMAGE_NO;
l.bot_attack = false;
}
else
{
- LOG_DEBUG(strcat(etos(l), " (generator) is not shielded\n"));
+ LOG_DEBUG(etos(l), " (generator) is not shielded");
l.takedamage = DAMAGE_AIM;
l.bot_attack = true;
}
{
if (l.isshielded)
{
- LOG_DEBUG(strcat(etos(l), " (point) is shielded\n"));
+ LOG_DEBUG(etos(l), " (point) is shielded");
if (l.goalentity)
{
l.goalentity.takedamage = DAMAGE_NO;
}
else
{
- LOG_DEBUG(strcat(etos(l), " (point) is not shielded\n"));
+ LOG_DEBUG(etos(l), " (point) is not shielded");
if (l.goalentity)
{
l.goalentity.takedamage = DAMAGE_AIM;
if(!this.goalentity) { objerror(this, "can not find target\n"); }
if(!this.enemy) { objerror(this, "can not find target2\n"); }
- LOG_DEBUG(strcat(etos(this.goalentity), " linked with ", etos(this.enemy), "\n"));
+ LOG_DEBUG(etos(this.goalentity), " linked with ", etos(this.enemy));
this.SendFlags |= 3;
setthink(this, ons_Link_CheckUpdate);
this.nextthink = time;
if(!needweapons && !needarmor)
return;
- LOG_DEBUG(strcat(this.netname, " needs weapons ", ftos(needweapons) , "\n"));
- LOG_DEBUG(strcat(this.netname, " needs armor ", ftos(needarmor) , "\n"));
+ LOG_DEBUG(this.netname, " needs weapons ", ftos(needweapons));
+ LOG_DEBUG(this.netname, " needs armor ", ftos(needarmor));
// See what is around
FOREACH_ENTITY_FLOAT(bot_pickup, true,
void havocbot_role_ons_setrole(entity this, int role)
{
- LOG_DEBUG(strcat(this.netname," switched to "));
+ LOG_DEBUG(this.netname," switched to ");
switch(role)
{
case HAVOCBOT_ONS_ROLE_DEFENSE:
this.havocbot_role_timeout = 0;
break;
}
- LOG_DEBUG("\n");
+ LOG_DEBUG("");
}
void havocbot_goalrating_ons_controlpoints_attack(entity this, float ratingscale)
if (!cp)
return;
- LOG_DEBUG(strcat(this.netname, " chose cp ranked ", ftos(bestvalue), "\n"));
+ LOG_DEBUG(this.netname, " chose cp ranked ", ftos(bestvalue));
if(cp.goalentity)
{
{
navigation_routerating(this, cp, ratingscale, 10000);
}
- LOG_DEBUG(strcat(this.netname, " found an attackable controlpoint at ", vtos(cp.origin) ,"\n"));
+ LOG_DEBUG(this.netname, " found an attackable controlpoint at ", vtos(cp.origin));
}
else
{
// Should be touched
- LOG_DEBUG(strcat(this.netname, " found a touchable controlpoint at ", vtos(cp.origin) ,"\n"));
+ LOG_DEBUG(this.netname, " found a touchable controlpoint at ", vtos(cp.origin));
found = false;
// Look for auto generated waypoint
if(bestwp)
{
- LOG_DEBUG("waypoints found around generator\n");
+ LOG_DEBUG("waypoints found around generator");
navigation_routerating(this, bestwp, ratingscale, 10000);
bestwp.cnt += 1;
}
else
{
- LOG_DEBUG("generator found without waypoints around\n");
+ LOG_DEBUG("generator found without waypoints around");
// if there aren't waypoints near the generator go straight to it
navigation_routerating(this, g, ratingscale, 10000);
this.havocbot_attack_time = 0;
.int fld = inv_items[it.m_id];
int prev = this.(fld);
int next = this.(fld) = ReadByte();
- LOG_TRACEF("%s: %.0f -> %.0f\n", it.m_name, prev, next);
+ LOG_TRACEF("%s: %.0f -> %.0f", it.m_name, prev, next);
});
return true;
}
TC(Pickup, this);
bool b = Item_GiveTo(item, player);
if (b) {
- LOG_DEBUGF("entity %i picked up %s\n", player, this.m_name);
+ LOG_DEBUGF("entity %i picked up %s", player, this.m_name);
player.inventory.inv_items[this.m_id]++;
Inventory_update(player);
}
if(MapInfo_Get_ByName(_MapInfo_GlobItem(i), 1, NULL) == 2) // if we generated one... BAIL OUT and let the caller continue in the next frame.
if(pAbortOnGenerate)
{
- LOG_TRACE("Autogenerated a .mapinfo, doing the rest later.\n");
+ LOG_TRACE("Autogenerated a .mapinfo, doing the rest later.");
MapInfo_progress = i / _MapInfo_globcount;
return 0;
}
LOG_TRACE("-> diameter ", ftos(diameter));
LOG_TRACE("; spawnpoints ", ftos(spawnpoints));
- LOG_TRACE("; modes ", ftos(MapInfo_Map_supportedGametypes), "\n");
+ LOG_TRACE("; modes ", ftos(MapInfo_Map_supportedGametypes));
fclose(fh);
{
if(type == 0) // server set
{
- LOG_TRACE("Applying temporary setting ", t, " := ", s, "\n");
+ LOG_TRACE("Applying temporary setting ", t, " := ", s);
if(cvar("g_campaign"))
cvar_set(t, s); // this is a wrapper and is always temporary anyway; no need to backup old values then
else
}
else
{
- LOG_TRACE("Applying temporary client setting ", t, " := ", s, "\n");
+ LOG_TRACE("Applying temporary client setting ", t, " := ", s);
MapInfo_Map_clientstuff = strcat(
MapInfo_Map_clientstuff, "cl_cmd settemp \"", t, "\" \"", s, "\"\n"
);
{
if(cvar("g_mapinfo_allow_unsupported_modes_and_let_stuff_break"))
{
- LOG_SEVERE("can't play the selected map in the given game mode. Working with only the override settings.\n");
+ LOG_SEVERE("can't play the selected map in the given game mode. Working with only the override settings.");
_MapInfo_Map_ApplyGametypeEx("", t, t);
return; // do not call Get_ByName!
}
if(MapInfo_Map_supportedGametypes == 0)
{
- LOG_SEVERE("Mapinfo system is not functional at all. Assuming deathmatch.\n");
+ LOG_SEVERE("Mapinfo system is not functional at all. Assuming deathmatch.");
MapInfo_Map_supportedGametypes = MAPINFO_TYPE_DEATHMATCH.m_flags;
MapInfo_LoadMapSettings_SaveGameType(MAPINFO_TYPE_DEATHMATCH);
_MapInfo_Map_ApplyGametypeEx("", MAPINFO_TYPE_DEATHMATCH, MAPINFO_TYPE_DEATHMATCH);
FOREACH(Gametypes, it.m_flags == _t, { t = it; break; });
// t is now a supported mode!
- LOG_WARN("can't play the selected map in the given game mode. Falling back to a supported mode.\n");
+ LOG_WARN("can't play the selected map in the given game mode. Falling back to a supported mode.");
MapInfo_LoadMapSettings_SaveGameType(t);
}
MapInfo_Get_ByName(s, 1, t);
void minigame_autoclean_entity(entity e)
{
- LOG_DEBUG("CL Auto-cleaned: ",ftos(etof(e)), " (",e.classname,")\n");
+ LOG_DEBUG("CL Auto-cleaned: ",ftos(etof(e)), " (",e.classname,")");
delete(e);
}
if ( !minigame.descriptor || minigame.classname != "minigame" )
{
- LOG_TRACE("Trying to activate unregistered minigame ",minigame.netname," in client\n");
+ LOG_TRACE("Trying to activate unregistered minigame ",minigame.netname," in client");
return;
}
this.owner = find(this.owner,netname,owner_name);
while ( this.owner && this.owner.classname != "minigame" );
if ( !this.owner )
- LOG_TRACE("Got a minigame entity without a minigame!\n");
+ LOG_TRACE("Got a minigame entity without a minigame!");
}
NET_HANDLE(ENT_CLIENT_MINIGAME, bool isnew)
{
this.entremove = minigame_entremove;
this.descriptor = minigame_get_descriptor(ReadString_Raw());
if ( !this.descriptor )
- LOG_TRACE("Got a minigame without a client-side descriptor!\n");
+ LOG_TRACE("Got a minigame without a client-side descriptor!");
else
this.minigame_event = this.descriptor.minigame_event;
}
minigame_read_owner(this);
float ent = ReadLong();
this.minigame_playerslot = ent;
- LOG_DEBUG("Player: ",entcs_GetName(ent-1),"\n");
+ LOG_DEBUG("Player: ",entcs_GetName(ent-1));
activate = (ent == player_localnum+1 && this.owner && this.owner != active_minigame);
{
LOG_DEBUG("CL Reading entity: ",ftos(etof(this)),
" classname:",this.classname," enttype:",ftos(this.enttype) );
- LOG_DEBUG(" sf:",ftos(sf)," netname:",this.netname,"\n\n");
+ LOG_DEBUG(" sf:",ftos(sf)," netname:",this.netname);
}
return true;
}
minigame.SendFlags |= MINIG_SF_UPDATE;
}
else
- LOG_TRACE("Invalid move: ",...(2,string),"\n");
+ LOG_TRACE("Invalid move: ", ...(2, string));
return 1;
}
}
f <<= 1;
}
- LOG_TRACE(sprintf("TTT AI: selected %x from %x\n",
+ LOG_TRACE(sprintf("TTT AI: selected %x from %x",
RandomSelection_chosen_float, piecemask) );
return RandomSelection_chosen_float;
}
r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A3,TTT_AI_POSFLAG_B3,TTT_AI_POSFLAG_C3);
r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A1,TTT_AI_POSFLAG_B2,TTT_AI_POSFLAG_C3);
r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A3,TTT_AI_POSFLAG_B2,TTT_AI_POSFLAG_C1);
- LOG_TRACE(sprintf("TTT AI: possible 3 in a rows in %x: %x (%x)\n",piecemask,r, r&piecemask_free));
+ LOG_TRACE(sprintf("TTT AI: possible 3 in a rows in %x: %x (%x)",piecemask,r, r&piecemask_free));
r &= piecemask_free;
return ttt_ai_random(r);
}
{
int move = 0;
- LOG_TRACE("TTT AI: checking winning move\n");
+ LOG_TRACE("TTT AI: checking winning move");
if (( move = ttt_ai_block3(piecemask_self,piecemask_free) ))
return ttt_ai_piece_flag2pos(move); // place winning move
- LOG_TRACE("TTT AI: checking opponent's winning move\n");
+ LOG_TRACE("TTT AI: checking opponent's winning move");
if (( move = ttt_ai_block3(piecemask_opponent,piecemask_free) ))
return ttt_ai_piece_flag2pos(move); // block opponent
- LOG_TRACE("TTT AI: random move\n");
+ LOG_TRACE("TTT AI: random move");
return ttt_ai_piece_flag2pos(ttt_ai_random(piecemask_free));
}
}
// TODO multiple AI difficulties
- LOG_TRACE(sprintf("TTT AI: self: %x opponent: %x free: %x\n",
+ LOG_TRACE(sprintf("TTT AI: self: %x opponent: %x free: %x",
piecemask_self, piecemask_opponent, piecemask_free));
pos = ttt_ai_choose_simple(piecemask_self, piecemask_opponent, piecemask_free);
- LOG_TRACE("TTT AI: chosen move: ",pos,"\n\n");
+ LOG_TRACE("TTT AI: chosen move: ", pos);
if ( !pos )
- LOG_TRACE("Tic Tac Toe AI has derped!\n");
+ LOG_TRACE("Tic Tac Toe AI has derped!");
else
ttt_move(minigame,aiplayer,pos);
}
GameLogEcho(strcat(":minigame:start:",minig.netname));
if ( ! minigame_addplayer(minig,player) )
{
- LOG_TRACE("Minigame ",minig.netname," rejected the first player join!\n");
+ LOG_TRACE("Minigame ",minig.netname," rejected the first player join!");
end_minigame(minig);
return NULL;
}
while( (e = findentity(e, owner, minigame_session)) )
if ( e.minigame_autoclean )
{
- LOG_TRACE("SV Auto-cleaned: ",ftos(etof(e)), " (",e.classname,")\n");
+ LOG_TRACE("SV Auto-cleaned: ",ftos(etof(e)), " (",e.classname,")");
delete(e);
}
TC(Model, this);
string s = this.model_str();
if (s != "" && s != "null" && !fexists(s)) {
- LOG_WARNF("Missing model: \"%s\"\n", s);
+ LOG_WARNF("Missing model: \"%s\"", s);
return;
}
- profile(sprintf("precache_model(\"%s\")\n", s));
+ profile(sprintf("precache_model(\"%s\")", s));
precache_model(s);
}
ENDCLASS(Model)
{
if(tokenize_console(s) != 3)
{
- LOG_TRACE("Invalid sound info line: ", s, "\n");
+ LOG_TRACE("Invalid sound info line: ", s);
continue;
}
PrecacheGlobalSound(strcat(argv(1), " ", argv(2)));
fh = fopen(f, FILE_READ);
if(fh < 0)
{
- LOG_TRACE("Monster sound file not found: ", f, "\n");
+ LOG_TRACE("Monster sound file not found: ", f);
return false;
}
while((s = fgets(fh)))
WITH(bool, mutator_log, true, LAMBDA(
FOREACH(Mutators, it.registered_id == s, { Mutator_Add(it); ++added; });
));
- if (added > 1) LOG_WARNF("Added more than one mutator for %s\n", s);
+ if (added > 1) LOG_WARNF("Added more than one mutator for %s", s);
}
}
#endif
mutatorfunc_t func = mut.mutatorfunc;
if (!func(MUTATOR_ADDING)) {
// good
- if (mutator_log) LOG_TRACEF("Mutator: added %s\n", mut.m_name);
+ if (mutator_log) LOG_TRACEF("Mutator: added %s", mut.m_name);
#ifdef SVQC
Net_LinkEntity(mut, false, 0, Mutator_SendEntity);
#endif
// baaaaad
error("Mutator_Remove: removing mutator failed");
}
- if (mutator_log) LOG_TRACEF("Mutator: removed %s\n", mut.m_name);
+ if (mutator_log) LOG_TRACEF("Mutator: removed %s", mut.m_name);
#ifdef SVQC
Net_UnlinkEntity(mut);
#endif
if (held_nade)
{
player.nade_timer = bound(0, (time - held_nade.nade_time_primed) / autocvar_g_nades_nade_lifetime, 1);
- // LOG_TRACEF("%d %d\n", player.nade_timer, time - held_nade.nade_time_primed);
+ // LOG_TRACEF("%d %d", player.nade_timer, time - held_nade.nade_time_primed);
makevectors(player.angles);
held_nade.velocity = player.velocity;
setorigin(held_nade, player.origin + player.view_ofs + v_forward * 8 + v_right * -8 + v_up * 0);
{
if (!(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")))
{
- LOG_TRACE("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n");
+ LOG_TRACE("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.");
return -1;
}
}
gravity_delay = time + autocvar_g_random_gravity_delay;
- LOG_TRACE("Gravity is now: ", ftos(autocvar_sv_gravity), "\n");
+ LOG_TRACE("Gravity is now: ", ftos(autocvar_sv_gravity));
}
MUTATOR_HOOKFUNCTION(random_gravity, BuildMutatorsString)
fh = fopen(fn, FILE_WRITE);
if(fh < 0)
{
- LOG_TRACE("^1ERROR: ^7 superspec can not open ", fn, " for writing.\n");
+ LOG_TRACE("^1ERROR: ^7 superspec can not open ", fn, " for writing.");
}
else
{
fh = fopen(fn, FILE_READ);
if(fh < 0)
{
- LOG_TRACE("^1ERROR: ^7 superspec can not open ", fn, " for reading.\n");
+ LOG_TRACE("^1ERROR: ^7 superspec can not open ", fn, " for reading.");
}
else
{
string _magic = fgets(fh);
if(_magic != _SSMAGIX)
{
- LOG_TRACE("^1ERROR^7 While reading superspec options file: unknown magic\n");
+ LOG_TRACE("^1ERROR^7 While reading superspec options file: unknown magic");
}
else
{
Get_Notif_TypeName(net_type)
));
#endif
- LOG_WARNF("Incorrect usage of Local_Notification: %s\n", "Null notification");
+ LOG_WARNF("Incorrect usage of Local_Notification: %s", "Null notification");
return;
}
case MSG_MULTI: return "MSG_MULTI";
case MSG_CHOICE: return "MSG_CHOICE";
}
- LOG_WARNF("Get_Notif_TypeName(%d): Improper net type!\n", ORDINAL(net_type));
+ LOG_WARNF("Get_Notif_TypeName(%d): Improper net type!", ORDINAL(net_type));
return "";
}
case NOTIF_TEAM: return "NOTIF_TEAM";
case NOTIF_TEAM_EXCEPT: return "NOTIF_TEAM_EXCEPT";
}
- LOG_WARNF("Get_Notif_BroadcastName(%d): Improper broadcast!\n", broadcast);
+ LOG_WARNF("Get_Notif_BroadcastName(%d): Improper broadcast!", broadcast);
return "";
}
{
Notification it = _Notifications_from(net_name, NULL);
if (it.nent_type != net_type) {
- LOG_WARNF("Get_Notif_Ent(%s (%d), %s (%d)): Improper net type '%s'!\n",
+ LOG_WARNF("Get_Notif_Ent(%s (%d), %s (%d)): Improper net type '%s'!",
Get_Notif_TypeName(net_type), net_type,
it.registered_id, net_name,
Get_Notif_TypeName(it.nent_type)
X(17)
#undef X
{
- LOG_DEBUGF("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n",
+ LOG_DEBUGF("Can't unstick an entity (edict: %d, classname: %s, origin: %s)",
etof(this), this.classname, vtos(this.origin));
return false;
}
}
- LOG_DEBUGF("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n",
+ LOG_DEBUGF("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)",
etof(this), this.classname, vtos(this.origin));
_Movetype_LinkEdict(this, true);
return true;
{
case MOVETYPE_PUSH:
case MOVETYPE_FAKEPUSH:
- LOG_DEBUGF("Physics: Lacking QuakeC support for Push movetype, FIX ME by using engine physics!\n");
+ LOG_DEBUGF("Physics: Lacking QuakeC support for Push movetype, FIX ME by using engine physics!");
break;
case MOVETYPE_NONE:
break;
{
case MOVETYPE_PUSH:
case MOVETYPE_FAKEPUSH:
- LOG_DEBUGF("Physics: Lacking QuakeC support for Push movetype, FIX ME by using engine physics!\n");
+ LOG_DEBUGF("Physics: Lacking QuakeC support for Push movetype, FIX ME by using engine physics!");
break;
case MOVETYPE_NONE:
break;
{
#ifdef SVQC
if(autocvar_speedmeter)
- LOG_TRACE(strcat("landing velocity: ", vtos(this.velocity), " (abs: ", ftos(vlen(this.velocity)), ")\n"));
+ LOG_TRACE("landing velocity: ", vtos(this.velocity), " (abs: ", ftos(vlen(this.velocity)), ")");
#endif
if(this.lastground < time - 0.3)
{
}
#ifdef SVQC
if(this.jumppadcount > 1)
- LOG_TRACE(strcat(ftos(this.jumppadcount), "x jumppad combo\n"));
+ LOG_TRACE(ftos(this.jumppadcount), "x jumppad combo");
this.jumppadcount = 0;
#endif
}
{
// url_fclose is processing, we got a response for writing the data
// this must come from HTTP
- LOG_TRACE("Got response from player stats server:\n");
- while((s = url_fgets(fh))) { LOG_TRACE(" ", s, "\n"); }
- LOG_TRACE("End of response.\n");
+ LOG_TRACE("Got response from player stats server:");
+ while((s = url_fgets(fh))) { LOG_TRACE(" ", s); }
+ LOG_TRACE("End of response.");
url_fclose(fh);
break;
}
case URL_READY_CLOSED:
{
// url_fclose has finished
- LOG_TRACE("Player stats written\n");
+ LOG_TRACE("Player stats written");
PlayerStats_GameReport_DelayMapVote = false;
if(PS_GR_OUT_DB >= 0)
{
// now request the information
uri = strcat(uri, "/player/", uri_escape(uri_escape(uri_escape(joiningplayer.crypto_idfp))), "/elo.txt");
- LOG_TRACE("Retrieving playerstats from URL: ", uri, "\n");
+ LOG_TRACE("Retrieving playerstats from URL: ", uri);
url_single_fopen(
uri,
FILE_APPEND,
{
// determine whether we should retrieve playerbasic information again
- LOG_TRACEF("PlayerStats_PlayerBasic_CheckUpdate('%s'): %f\n",
+ LOG_TRACEF("PlayerStats_PlayerBasic_CheckUpdate('%s'): %f",
joiningplayer.netname,
time
);
{
case URL_READY_CANWRITE:
{
- LOG_TRACE("-- Sending data to player stats server\n");
+ LOG_TRACE("-- Sending data to player stats server");
/*url_fputs(fh, "V 1\n");
#ifdef WATERMARK
url_fputs(fh, sprintf("R %s\n", WATERMARK));
// now actually set the event data
db_put(PS_D_IN_DB, sprintf("#%s", event), data);
- LOG_TRACE("Added item ", sprintf("#%s", event), "=", data, " to PS_D_IN_DB\n");
+ LOG_TRACE("Added item ", sprintf("#%s", event), "=", data, " to PS_D_IN_DB");
}
void PlayerStats_PlayerDetail()
PS_D_IN_DB = db_create();
//uri = strcat(uri, "/player/", uri_escape(crypto_getmyidfp(0)));
- LOG_TRACE("Retrieving playerstats from URL: ", autocvar_g_playerstats_playerdetail_uri, "\n");
+ LOG_TRACE("Retrieving playerstats from URL: ", autocvar_g_playerstats_playerdetail_uri);
url_single_fopen(
autocvar_g_playerstats_playerdetail_uri,
FILE_APPEND,
{
case URL_READY_CANWRITE:
{
- LOG_TRACE("PlayerStats_PlayerDetail_Handler(): Sending data to player stats server...\n");
+ LOG_TRACE("PlayerStats_PlayerDetail_Handler(): Sending data to player stats server...");
url_fputs(fh, "V 1\n");
#ifdef WATERMARK
url_fputs(fh, sprintf("R %s\n", WATERMARK));
/**/
#define tryext(ext) { string s = strcat(base, "." #ext); if (fexists(strcat("sound/", s))) return s; }
extensions(tryext);
- LOG_WARNF("Missing sound: \"%s\"\n", strcat("sound/", base));
+ LOG_WARNF("Missing sound: \"%s\"", strcat("sound/", base));
#undef tryext
#undef extensions
return string_null;
TC(Sound, this);
string s = Sound_fixpath(this);
if (!s) return;
- profile(sprintf("precache_sound(\"%s\")\n", s));
+ profile(sprintf("precache_sound(\"%s\")", s));
precache_sound(s);
}
ENDCLASS(Sound)
else
{
this.draw = ItemDraw;
- LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it\n");
+ LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it");
}
}
if(this.mdl == "")
- LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, ", tell tZork about this!\n");
+ LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, ", tell tZork about this!");
precache_model(this.mdl);
_setmodel(this, this.mdl);
WriteShort(MSG_ENTITY, this.fade_start);
if(this.mdl == "")
- LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, "expect a crash just about now\n");
+ LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, "expect a crash just about now");
WriteString(MSG_ENTITY, this.mdl);
}
if(this.effects & EF_NODRAW)
{
// marker for item team search
- LOG_TRACE("Initializing item team ", ftos(this.team), "\n");
+ LOG_TRACE("Initializing item team ", ftos(this.team));
RandomSelection_Init();
FOREACH_ENTITY_FLOAT(team, this.team,
{
// why not flags & fl_item?
FOREACH_ENTITY_RADIUS(this.origin, 3, it.is_item, {
LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(this.origin));
- LOG_TRACE(" vs ", it.netname, vtos(it.origin), "\n");
+ LOG_TRACE(" vs ", it.netname, vtos(it.origin));
error("Mapper sucks.");
});
this.is_item = true;
break;
}
}
- LOG_TRACE("\n");
+ LOG_TRACE("");
// collect health, targetname, message, size
cmins = this.absmin;
_sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE);
if(getsoundtime(e, CH_BGM_SINGLE) < 0)
{
- LOG_TRACEF("Cannot initialize sound %s\n", e.noise);
+ LOG_TRACEF("Cannot initialize sound %s", e.noise);
strunzone(e.noise);
e.noise = string_null;
}
_sound(this, CH_BGM_SINGLE, this.noise, 0, ATTEN_NONE);
if(getsoundtime(this, CH_BGM_SINGLE) < 0)
{
- LOG_TRACEF("Cannot initialize sound %s\n", this.noise);
+ LOG_TRACEF("Cannot initialize sound %s", this.noise);
strunzone(this.noise);
this.noise = string_null;
}
{
this.enemy = find(NULL, targetname, this.target);
if(this.enemy == NULL)
- LOG_TRACE("A turret_checkpoint faild to find its target!\n");
+ LOG_TRACE("A turret_checkpoint faild to find its target!");
}
//setthink(this, turret_checkpoint_think);
//this.nextthink = time + tc_acum + 0.25;
*/
#ifdef TURRET_DEBUG_TARGETSELECT
- LOG_TRACE("Target:",e_target.netname," is a valid target for ",e_turret.netname,"\n");
+ LOG_TRACE("Target:",e_target.netname," is a valid target for ",e_turret.netname);
#endif
return 1;
*/
void turret_use(entity this, entity actor, entity trigger)
{
- LOG_TRACE("Turret ",this.netname, " used by ", actor.classname, "\n");
+ LOG_TRACE("Turret ",this.netname, " used by ", actor.classname);
this.team = actor.team;
if (this.tur_defend == NULL)
{
this.target = "";
- LOG_TRACE("Turret has invalid defendpoint!\n");
+ LOG_TRACE("Turret has invalid defendpoint!");
}
}
e = find(NULL, targetname, it.target);
if (!e)
{
- LOG_TRACE("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
+ LOG_TRACE("Initital waypoint for ewheel does NOT exsist, fix your map!");
it.target = "";
}
if (e.classname != "turret_checkpoint")
- LOG_TRACE("Warning: not a turrret path\n");
+ LOG_TRACE("Warning: not a turrret path");
else
{
it.tur_head.frame = bound(0, 6 - floor(0.1 + it.ammo / it.shot_dmg), 6);
if(it.tur_head.frame < 0)
{
- LOG_TRACE("ammo:",ftos(it.ammo),"\n");
- LOG_TRACE("shot_dmg:",ftos(it.shot_dmg),"\n");
+ LOG_TRACE("ammo:",ftos(it.ammo));
+ LOG_TRACE("shot_dmg:",ftos(it.shot_dmg));
}
}
METHOD(MLRSTurret, tr_setup, void(MLRSTurret this, entity it))
e = find(NULL, targetname, it.target);
if (!e)
{
- LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!\n");
+ LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!");
it.target = "";
}
if (e.classname != "turret_checkpoint")
- LOG_TRACE("Warning: not a turrret path\n");
+ LOG_TRACE("Warning: not a turrret path");
else
{
#ifdef WALKER_FANCYPATHING
{
if(!this.tur_head)
{
- LOG_DEBUG("Call to turret_tag_fire_update with this.tur_head missing!\n");
+ LOG_DEBUG("Call to turret_tag_fire_update with this.tur_head missing!");
this.tur_shotorg = '0 0 0';
return false;
}
if (!(tmp_cvar || tmp_value))
{
- LOG_TRACE("Error: Invalid usage of cvar_settemp(string, string); !\n");
+ LOG_TRACE("Error: Invalid usage of cvar_settemp(string, string); !");
return 0;
}
void vehicle_use(entity this, entity actor, entity trigger)
{
- LOG_DEBUG("vehicle ", this.netname, " used by ", actor.classname, "\n");
+ LOG_DEBUG("vehicle ", this.netname, " used by ", actor.classname);
this.tur_head.team = actor.team;
if(this.active == ACTIVE_ACTIVE && !IS_DEAD(this) && !gameover)
{
- LOG_DEBUG("Respawning vehicle: ", this.netname, "\n");
+ LOG_DEBUG("Respawning vehicle: ", this.netname);
if(this.effects & EF_NODRAW)
{
setthink(this, vehicles_spawn);
if(vehicles_exit_running)
{
- LOG_TRACE("^1vehicles_exit already running! this is not good...\n");
+ LOG_TRACE("^1vehicles_exit already running! this is not good...");
return;
}
// initialization
void vehicles_spawn(entity this)
{
- LOG_DEBUG("Spawning vehicle: ", this.classname, "\n");
+ LOG_DEBUG("Spawning vehicle: ", this.classname);
// disown & reset
this.vehicle_hudmodel.viewmodelforclient = this;
this.vehicle_controller = find(NULL, target, this.targetname);
if(!this.vehicle_controller)
{
- LOG_DEBUG("^1WARNING: ^7Vehicle with invalid .targetname\n");
+ LOG_DEBUG("^1WARNING: ^7Vehicle with invalid .targetname");
this.active = ACTIVE_ACTIVE;
}
else
}
else if(!vehic.gunner1 && time >= vehic.gun1.phase) { gunner = vehic.gun1; vehic.gunner1 = player; }
else if(!vehic.gunner2 && time >= vehic.gun2.phase) { gunner = vehic.gun2; vehic.gunner2 = player; }
- else { LOG_TRACE("Vehicle is full, fail\n"); return false; }
+ else { LOG_TRACE("Vehicle is full, fail"); return false; }
player.vehicle = gunner;
player.angles = vehic.angles;
}
#if 0
- LOG_TRACE(vtos(camera_position), "\n");
- LOG_TRACE(vtos(old_camera_angle), "\n");
- LOG_TRACE(vtos(camera_angle), "\n");
+ LOG_TRACE(vtos(camera_position));
+ LOG_TRACE(vtos(old_camera_angle));
+ LOG_TRACE(vtos(camera_angle));
#endif
freeze_org = getpropertyvec(VF_ORIGIN);
}
else
{
- LOG_WARNF("weapon model %s does not support the 'shot' tag, will display shots TOTALLY wrong\n",
+ LOG_WARNF("weapon model %s does not support the 'shot' tag, will display shots TOTALLY wrong",
this.model);
this.movedir = '0 0 0';
}
}
else
{
- LOG_WARNF("weapon model %s does not support the 'shell' tag, will display casings wrong\n",
+ LOG_WARNF("weapon model %s does not support the 'shell' tag, will display casings wrong",
this.model);
this.spawnorigin = this.movedir;
}
else
inaccessible = strcat(inaccessible, "\n", it.netname);
});
- if (inaccessible) LOG_TRACEF("Impulse limit exceeded, weapon(s) will not be directly accessible: %s\n", inaccessible);
+ if (inaccessible) LOG_TRACEF("Impulse limit exceeded, weapon(s) will not be directly accessible: %s", inaccessible);
#ifdef CSQC
FOREACH(Weapons, true, it.wr_init(it));
#endif
{
bool b = Item_GiveTo(item, player);
if (b) {
- LOG_TRACEF("entity %i picked up %s\n", player, this.m_name);
+ LOG_TRACEF("entity %i picked up %s", player, this.m_name);
}
return b;
}
#endif
#ifdef CSQC
METHOD(PortoLaunch, wr_impacteffect, void(entity this, entity actor)) {
- LOG_WARN("Since when does Porto send DamageInfo?\n");
+ LOG_WARN("Since when does Porto send DamageInfo?");
}
#endif
#endif
{
if (i < maxclients) return CSQCModel_players[i];
++i;
- LOG_DEBUGF("player out of bounds: %d\n", i);
+ LOG_DEBUGF("player out of bounds: %d", i);
return findfloat(NULL, entnum, i);
}
void CSQCPlayer_Unpredict(entity this)
{
if (csqcplayer_status == CSQCPLAYERSTATUS_UNPREDICTED) return;
- if (csqcplayer_status != CSQCPLAYERSTATUS_PREDICTED) LOG_FATALF("Cannot unpredict in current status (%d)\n", csqcplayer_status);
+ if (csqcplayer_status != CSQCPLAYERSTATUS_PREDICTED) LOG_FATALF("Cannot unpredict in current status (%d)", csqcplayer_status);
this.origin = csqcplayer_origin;
this.velocity = csqcplayer_velocity;
csqcplayer_moveframe = csqcplayer_sequence + 1; // + 1 because the recieved frame has the move already done (server side)
int p = strstrofs(s, "^", 0);
string ret = (p < 0) ? s : substring(s, p + 1, -1);
#if CTX_CACHE
- LOG_DEBUGF("CTX(\"%s\")\n", s);
+ LOG_DEBUGF("CTX(\"%s\")", s);
HM_sets(CTX_cache, s, ret);
#endif
return ret;
entity otail = this.il_tail;
next ? next.(il_prev) = prev : this.il_tail = prev;
prev ? prev.(il_next) = next : this.il_head = next;
- LOG_DEBUGF("remove %i (%i :: %i), head: %i -> %i, tail: %i -> %i\n", it, it.(il_prev), it.(il_next), ohead, this.il_head, otail, this.il_tail);
+ LOG_DEBUGF("remove %i (%i :: %i), head: %i -> %i, tail: %i -> %i", it, it.(il_prev), it.(il_next), ohead, this.il_head, otail, this.il_tail);
it.(il_next) = it.(il_prev) = NULL;
}
#if defined(MENUQC)
-string(string...) strcat0n = #53;
+string(string, string...) strcat1n = #53;
#else
-string(string...) strcat0n = #115;
+string(string, string...) strcat1n = #115;
#endif
+// would be nice if __FUNC__ could be concatenated at compile time
#define __SOURCELOC__ (sprintf("^7%s^9" "(" "^9"__FILE__"^7" ":" "^9"STR(__LINE__)"^7" ")", __FUNC__))
+#define _LOG_HEADER(level) "^9[::" "^7"PROGNAME"^9" "::" level"^9" "] ", __SOURCELOC__
#define _LOG(f, level, s) \
MACRO_BEGIN { \
- f(sprintf("^9[::" "^7"PROGNAME"^9" "::" level"^9" "] %s\n^7%s\n", __SOURCELOC__, s)); \
+ f(strcat1n(_LOG_HEADER(level), "\n^7", s, "\n")); \
} MACRO_END
-#define LOG_FATAL(...) _LOG_FATAL(strcat0n(__VA_ARGS__))
+#define LOG_FATAL(...) _LOG_FATAL(strcat1n(__VA_ARGS__))
#define LOG_FATALF(...) _LOG_FATAL(sprintf(__VA_ARGS__))
#define _LOG_FATAL(s) _LOG(error, "^1FATAL", s)
-#define LOG_SEVERE(...) _LOG_SEVERE(strcat0n(__VA_ARGS__))
+#define LOG_SEVERE(...) _LOG_SEVERE(strcat1n(__VA_ARGS__))
#define LOG_SEVEREF(...) _LOG_SEVERE(sprintf(__VA_ARGS__))
#define _LOG_SEVERE(s) _LOG(backtrace, "^1SEVERE", s)
-#define LOG_WARN(...) _LOG_WARN(strcat0n(__VA_ARGS__))
+#define LOG_WARN(...) _LOG_WARN(strcat1n(__VA_ARGS__))
#define LOG_WARNF(...) _LOG_WARN(sprintf(__VA_ARGS__))
#define _LOG_WARN(s) _LOG(print, "^3WARNING", s)
-#define LOG_INFO(...) _LOG_INFO(strcat0n(__VA_ARGS__))
+#define LOG_INFO(...) _LOG_INFO(strcat1n(__VA_ARGS__))
#define LOG_INFOF(...) _LOG_INFO(sprintf(__VA_ARGS__))
#define _LOG_INFO(s) \
MACRO_BEGIN { \
- string ___s = s; \
- if (autocvar_developer) \
- _LOG(print, "^5INFO", ___s); \
- else \
- print(___s); \
+ dprint(_LOG_HEADER("^5INFO")); \
+ print("\n^7", s); \
} MACRO_END
-#define LOG_TRACE(...) _LOG_TRACE(strcat0n(__VA_ARGS__))
+#define LOG_TRACE(...) _LOG_TRACE(strcat1n(__VA_ARGS__))
#define LOG_TRACEF(...) _LOG_TRACE(sprintf(__VA_ARGS__))
#define _LOG_TRACE(s) _LOG(dprint, "^6TRACE", s)
-#define LOG_DEBUG(...) _LOG_DEBUG(strcat0n(__VA_ARGS__))
+#define LOG_DEBUG(...) _LOG_DEBUG(strcat1n(__VA_ARGS__))
#define LOG_DEBUGF(...) _LOG_DEBUG(sprintf(__VA_ARGS__))
#define _LOG_DEBUG(s) _LOG(dprint2, "^2DEBUG", s)
int fh = fopen(filename, FILE_WRITE);
if (fh < 0)
{
- LOG_WARNF("^1Can't write DB to %s\n", filename);
+ LOG_WARNF("^1Can't write DB to %s", filename);
return;
}
fputs(fh, strcat(ftos(DB_BUCKETS), "\n"));
void db_dump(int db, string filename)
{
int fh = fopen(filename, FILE_WRITE);
- if (fh < 0) LOG_FATALF("Can't dump DB to %s\n");
+ if (fh < 0) LOG_FATALF("Can't dump DB to %s");
fputs(fh, "0\n");
for (int i = 0, n = buf_getsize(db); i < n; ++i)
{
{
entity reader = C2S_Protocol_from(C2S);
if (reader && reader.m_read && reader.m_read(NULL, sender, true)) continue;
- LOG_SEVEREF("Net_ClientCommand() with malformed C2S=%d\n", C2S);
+ LOG_SEVEREF("Net_ClientCommand() with malformed C2S=%d", C2S);
return;
}
g_buf_i--;
{
if (DistributeEvenly_amount)
{
- LOG_TRACE("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ");
- LOG_TRACE(ftos(DistributeEvenly_totalweight), " left!)\n");
+ LOG_TRACE("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ", ftos(DistributeEvenly_totalweight), " left!)");
}
if (totalweight == 0) DistributeEvenly_amount = 0;
else DistributeEvenly_amount = amount;
prandom_seed = c;
#ifdef USE_PRANDOM_DEBUG
- LOG_TRACE("RANDOM -> ", ftos(c), "\n");
+ LOG_TRACE("RANDOM -> ", ftos(c));
#endif
return c / 65536; // in [0..1[
{
prandom_seed = seed;
#ifdef USE_PRANDOM_DEBUG
- LOG_TRACE("SRANDOM ", ftos(seed), "\n");
+ LOG_TRACE("SRANDOM ", ftos(seed));
#endif
}
#ifdef USE_PRANDOM_DEBUG
void prandom_debug()
{
- LOG_TRACE("Current random seed = ", ftos(prandom_seed), "\n");
+ LOG_TRACE("Current random seed = ", ftos(prandom_seed));
}
#endif
#endif
FOREACH(id, true, s = strcat(s, join, it.registered_id)); \
s = substring(s, strlen(join), -1); \
string h = REGISTRY_HASH(id) = strzone(digest_hex(algo, s)); \
- LOG_DEBUGF(#id ": %s\n[%s]\n", h, s); \
+ LOG_DEBUGF(#id ": %s\n[%s]", h, s); \
} \
void Registry_check(string r, string sv) \
{ \
string cl = REGISTRY_HASH(id); \
if (cl != sv) \
{ \
- LOG_FATALF("client/server mismatch (%s).\nCL: %s\nSV: %s\n", r, cl, sv); \
+ LOG_FATALF("client/server mismatch (%s).\nCL: %s\nSV: %s", r, cl, sv); \
} \
} \
} \
#define _spawnfunc_checktypes(fld) \
if (fieldname == #fld) \
- if (!entityfieldassignablefromeditor(i)) LOG_FATALF("Entity field '%s' cannot be whitelisted\n", fieldname);
+ if (!entityfieldassignablefromeditor(i)) LOG_FATALF("Entity field '%s' cannot be whitelisted", fieldname);
#else
#define _spawnfunc_checktypes(fld)
#endif
if (fieldname == "") continue; \
FIELDS_COMMON(_spawnfunc_check) \
whitelist(_spawnfunc_check) \
- LOG_WARNF(_("Entity field %s.%s (%s) is not whitelisted. If you believe this is an error, please file an issue.\n"), #id, fieldname, value); \
+ LOG_WARNF(_("Entity field %s.%s (%s) is not whitelisted. If you believe this is an error, please file an issue."), #id, fieldname, value); \
} \
this.spawnfunc_checked = true; \
} \
#define SUCCEED() (TEST_ok = true)
/** Add a failure, but continue */
-#define ADD_FAILURE(msg) MACRO_BEGIN { ++TEST_failed; LOG_WARNF(msg); } MACRO_END
+#define ADD_FAILURE(msg) MACRO_BEGIN { ++TEST_failed; LOG_WARN(msg); } MACRO_END
/** Add a failure and return */
#define FAIL(msg) _TEST_ASSERT(ADD_FAILURE(msg))
else if (e.url_fh == URL_FH_STDOUT)
{
// stdout
- LOG_INFO(s);
+ print(s);
}
else
{
#ifdef CSQC
if (trace_networkentity)
{
- LOG_TRACE("hit a network ent, cannot continue WarpZoneLib_BoxTouchesBrush\n");
+ LOG_TRACE("hit a network ent, cannot continue WarpZoneLib_BoxTouchesBrush");
// we cannot continue, as a player blocks us...
// so, abort
return 0;
{
if(--i < 1)
{
- LOG_TRACE("Too many warpzones in sequence, aborting trace.\n");
+ LOG_TRACE("Too many warpzones in sequence, aborting trace.");
trace_ent = NULL;
break;
}
if(trace_ent == wz)
{
// FIXME can this check be removed? Do we really need it?
- LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n");
+ LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace");
trace_ent = NULL;
break;
}
{
if(--i < 1)
{
- LOG_TRACE("Too many warpzones in sequence, aborting trace.\n");
+ LOG_TRACE("Too many warpzones in sequence, aborting trace.");
trace_ent = NULL;
break;
}
if(trace_ent == wz)
{
// FIXME can this check be removed? Do we really need it?
- LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n");
+ LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace");
trace_ent = NULL;
break;
}
}
else
{
- LOG_TRACE("WARPZONE FAIL AHAHAHAHAH))\n");
+ LOG_TRACE("WARPZONE FAIL AHAHAHAHAH))");
}
}
void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
{
if(theSize.x <= 0 || theSize.y <= 0) {
- LOG_TRACE("Drawing zero size text?\n");
+ LOG_TRACE("Drawing zero size text?");
return;
}
{
if (!me.overrideRealOrigin_x) me.realOrigin_x = me.keepspaceLeft;
if (!me.overrideCondenseFactor) me.condenseFactor = spaceAvail / spaceUsed;
- LOG_TRACEF("NOTE: label text %s too wide for label, condensed by factor %f\n", t, me.condenseFactor);
+ LOG_TRACEF("NOTE: label text %s too wide for label, condensed by factor %f", t, me.condenseFactor);
}
if (!me.overrideRealOrigin_y)
if (mouseButtonsPressed < 0)
{
mouseButtonsPressed = 0;
- LOG_TRACE("Warning: released an already released button\n");
+ LOG_TRACE("Warning: released an already released button");
}
}
if (key == K_ALT) menuShiftState &= ~S_ALT;
if (mouseButtonsPressed > 10)
{
mouseButtonsPressed = 10;
- LOG_TRACE("Warning: pressed an already pressed button\n");
+ LOG_TRACE("Warning: pressed an already pressed button");
}
}
if (key == K_ALT) menuShiftState |= S_ALT;
//#define SKINSTRING(name,def) case #name: break
#define SKINSTRING(name,def) case #name: SKIN##name = strzone(_value); break
// I know this leaks memory when skin is read multiple times. Screw it.
-#define SKINEND case "": break; case "//": break; default: LOG_TRACE("Invalid key in skin file: ", key, "\n"); } }
+#define SKINEND case "": break; case "//": break; default: LOG_TRACE("Invalid key in skin file: ", key); } }
#include "skin-customizables.inc"
#undef SKINEND
#undef SKINSTRING
case "cts":
case "xdf": { return CAT_DEFRAG; }
- default: { LOG_TRACEF("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
+ default: { LOG_TRACEF("Found strange mod type: %s", modtype); return CAT_MODIFIED; }
}
}
minfactor = min(1, 640 / c.x); // can be > 1 only if c_x is <640
maxfactor = max(1, r.x / c.x, r.y / c.y); // can be < 1 only if r_x < c_x and r_y < c_y
- LOG_TRACE("min factor: ", ftos(minfactor), "\n");
- LOG_TRACE("max factor: ", ftos(maxfactor), "\n");
+ LOG_TRACE("min factor: ", ftos(minfactor));
+ LOG_TRACE("max factor: ", ftos(maxfactor));
if(sz < 0)
f = 1 - (maxfactor - 1) * sz;
r = getresolution(-1);
if(r.x != 0 || r.y != 0)
me.addResolution(me, r.x, r.y, r.z);
- LOG_TRACE("Added system resolutions.\n");
+ LOG_TRACE("Added system resolutions.");
}
if(me.nValues == 0)
me.addResolution(me, 1280, 960, 1); // pc res
me.addResolution(me, 1280, 1024, 1); // pc res
me.addResolution(me, 1920, 1080, 1); // 1080p
- LOG_TRACE("Added default resolutions.\n");
+ LOG_TRACE("Added default resolutions.");
}
- LOG_TRACE("Total number of resolutions detected: ", ftos(me.nValues), "\n");
+ LOG_TRACE("Total number of resolutions detected: ", ftos(me.nValues));
me.vid_fullscreen = fullscreen;
void XonoticStatsList_getStats(entity me)
{
- LOG_TRACE("XonoticStatsList_getStats() at time: ", ftos(time), "\n");
+ LOG_TRACE("XonoticStatsList_getStats() at time: ", ftos(time));
// delete the old buffer if it exists
if(me.listStats >= 0)
buf_del(me.listStats);
if(_Nex_ExtResponseSystem_UpdateTo)
{
- LOG_TRACE("error: UpdateNotification_URI_Get_Callback has been called before\n");
+ LOG_TRACE("error: UpdateNotification_URI_Get_Callback has been called before");
return;
}
if(status != 0)
{
- LOG_TRACEF("error receiving update notification: status is %d\n", status);
+ LOG_TRACEF("error receiving update notification: status is %d", status);
return;
}
if(substring(data, 0, 1) == "<")
{
- LOG_TRACE("error: received HTML instead of an update notification\n");
+ LOG_TRACE("error: received HTML instead of an update notification");
return;
}
if(strstrofs(data, "\r", 0) != -1)
{
- LOG_TRACE("error: received carriage returns from update notification server\n");
+ LOG_TRACE("error: received carriage returns from update notification server");
return;
}
spawnfunc(worldspawn)
{
float r;
- LOG_TRACE("TESTCASE: START\n");
+ LOG_TRACE("TESTCASE: START");
r = test();
if(r == 1)
error("TESTCASE: PASS");
shotspeedupward *= W_WeaponSpeedFactor(this);
if (!shotspeed)
{
- LOG_TRACE("bot_aim: WARNING: weapon ", PS(this).m_weapon.m_name, " shotspeed is zero!\n");
+ LOG_TRACE("bot_aim: WARNING: weapon ", PS(this).m_weapon.m_name, " shotspeed is zero!");
shotspeed = 1000000;
}
if (!maxshottime)
{
- LOG_TRACE("bot_aim: WARNING: weapon ", PS(this).m_weapon.m_name, " maxshottime is zero!\n");
+ LOG_TRACE("bot_aim: WARNING: weapon ", PS(this).m_weapon.m_name, " maxshottime is zero!");
maxshottime = 1;
}
makevectors(this.v_angle);
++currentbots;
}
});
- LOG_TRACE(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
+ LOG_TRACE("relink: ", ftos(currentbots), " bots seen.");
bot_strategytoken = bot_list;
bot_strategytoken_taken = true;
}
LOG_TRACE("best bot got ", ftos(bestbot), "; ");
if(bestbot < 0 || bestplayer < 0)
{
- LOG_TRACE("not doing anything\n");
+ LOG_TRACE("not doing anything");
// don't return, let it reset all counters below
}
else if(bestbot <= bestplayer * factor - 2)
{
if(autocvar_skill < 17)
{
- LOG_TRACE("2 frags difference, increasing skill\n");
+ LOG_TRACE("2 frags difference, increasing skill");
cvar_set("skill", ftos(autocvar_skill + 1));
bprint("^2SKILL UP!^7 Now at level ", ftos(autocvar_skill), "\n");
}
{
if(autocvar_skill > 0)
{
- LOG_TRACE("2 frags difference, decreasing skill\n");
+ LOG_TRACE("2 frags difference, decreasing skill");
cvar_set("skill", ftos(autocvar_skill - 1));
bprint("^1SKILL DOWN!^7 Now at level ", ftos(autocvar_skill), "\n");
}
}
else
{
- LOG_TRACE("not doing anything\n");
+ LOG_TRACE("not doing anything");
return;
// don't reset counters, wait for them to accumulate
}
threshold = maxspeed * 0.2;
if(vdist(velxy, <, threshold))
{
- LOG_TRACE("Warning: ", this.netname, " got stuck on a jumppad (velocity in xy is ", vtos(velxy), "), trying to get out of it now\n");
+ LOG_TRACE("Warning: ", this.netname, " got stuck on a jumppad (velocity in xy is ", vtos(velxy), "), trying to get out of it now");
this.aistatus |= AI_STATUS_OUT_JUMPPAD;
}
return;
if(tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos))
{
// Remove dangerous dynamic goals from stack
- LOG_TRACE("bot ", this.netname, " avoided the goal ", this.goalcurrent.classname, " ", etos(this.goalcurrent), " because it led to a dangerous path; goal stack cleared\n");
+ LOG_TRACE("bot ", this.netname, " avoided the goal ", this.goalcurrent.classname, " ", etos(this.goalcurrent), " because it led to a dangerous path; goal stack cleared");
navigation_clearroute(this);
return;
}
// Step 4: Move to waypoint
if(this.havocbot_personal_waypoint==NULL)
{
- LOG_TRACE("Error: ", this.netname, " trying to walk to a non existent personal waypoint\n");
+ LOG_TRACE("Error: ", this.netname, " trying to walk to a non existent personal waypoint");
this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
return CMD_STATUS_ERROR;
}
bot_strategytoken_taken = true;
if(havocbot_moveto_refresh_route(this))
{
- LOG_TRACE(this.netname, " walking to its personal waypoint (after ", ftos(this.havocbot_personal_waypoint_failcounter), " failed attempts)\n");
+ LOG_TRACE(this.netname, " walking to its personal waypoint (after ", ftos(this.havocbot_personal_waypoint_failcounter), " failed attempts)");
this.havocbot_personal_waypoint_searchtime = time + 10;
this.havocbot_personal_waypoint_failcounter = 0;
}
this.havocbot_personal_waypoint_searchtime = time + 2;
if(this.havocbot_personal_waypoint_failcounter >= 30)
{
- LOG_TRACE("Warning: can't walk to the personal waypoint located at ", vtos(this.havocbot_personal_waypoint.origin),"\n");
+ LOG_TRACE("Warning: can't walk to the personal waypoint located at ", vtos(this.havocbot_personal_waypoint.origin));
this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_LINKING;
delete(this.havocbot_personal_waypoint);
return CMD_STATUS_ERROR;
}
else
- LOG_TRACE(this.netname, " can't walk to its personal waypoint (after ", ftos(this.havocbot_personal_waypoint_failcounter), " failed attempts), trying later\n");
+ LOG_TRACE(this.netname, " can't walk to its personal waypoint (after ", ftos(this.havocbot_personal_waypoint_failcounter), " failed attempts), trying later");
}
}
if(this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_REACHED)
{
// Step 5: Waypoint reached
- LOG_TRACE(this.netname, "'s personal waypoint reached\n");
+ LOG_TRACE(this.netname, "'s personal waypoint reached");
delete(this.havocbot_personal_waypoint);
this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_REACHED;
return CMD_STATUS_FINISHED;
// Wait until it is linked
if(!this.havocbot_personal_waypoint.wplinked)
{
- LOG_TRACE(this.netname, " waiting for personal waypoint to be linked\n");
+ LOG_TRACE(this.netname, " waiting for personal waypoint to be linked");
return CMD_STATUS_EXECUTING;
}
this.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_GOING;
// Step 3: Route to waypoint
- LOG_TRACE(this.netname, " walking to its personal waypoint\n");
+ LOG_TRACE(this.netname, " walking to its personal waypoint");
return CMD_STATUS_EXECUTING;
}
wp = waypoint_spawnpersonal(this, pos);
if(wp==NULL)
{
- LOG_TRACE("Error: Can't spawn personal waypoint at ",vtos(pos),"\n");
+ LOG_TRACE("Error: Can't spawn personal waypoint at ",vtos(pos));
return CMD_STATUS_ERROR;
}
void havocbot_chooserole(entity this)
{
- LOG_TRACE("choosing a role...\n");
+ LOG_TRACE("choosing a role...");
this.bot_strategytime = 0;
if(!MUTATOR_CALLHOOK(HavocBot_ChooseRole, this))
havocbot_chooserole_generic(this);
{
vector pointa, pointb;
- LOG_DEBUG("jetpack ai: evaluating path for ", e.classname, "\n");
+ LOG_DEBUG("jetpack ai: evaluating path for ", e.classname);
// Point A
traceline(this.origin, this.origin + '0 0 65535', MOVE_NORMAL, this);
if(trace_fraction==1)
{
- LOG_DEBUG("jetpack ai: can bridge these two points\n");
+ LOG_DEBUG("jetpack ai: can bridge these two points");
// Lower the altitude of these points as much as possible
float zdistance, xydistance, cost, t, fuel;
t += xydistance / autocvar_g_jetpack_maxspeed_side;
fuel = t * autocvar_g_jetpack_fuel * 0.8;
- LOG_DEBUG(strcat("jetpack ai: required fuel ", ftos(fuel), " this.ammo_fuel ", ftos(this.ammo_fuel), "\n"));
+ LOG_DEBUG("jetpack ai: required fuel ", ftos(fuel), " this.ammo_fuel ", ftos(this.ammo_fuel));
// enough fuel ?
if(this.ammo_fuel>fuel)
if (navigation_bestrating < f)
{
- LOG_DEBUG(strcat("jetpack path: added goal ", e.classname, " (with rating ", ftos(f), ")\n"));
+ LOG_DEBUG("jetpack path: added goal ", e.classname, " (with rating ", ftos(f), ")");
navigation_bestrating = f;
navigation_bestgoal = e;
this.navigation_jetpack_goal = e;
e.nearestwaypoint = nwp;
else
{
- LOG_DEBUG(strcat("FAILED to find a nearest waypoint to '", e.classname, "' #", etos(e), "\n"));
+ LOG_DEBUG("FAILED to find a nearest waypoint to '", e.classname, "' #", etos(e));
if(e.flags & FL_ITEM)
e.blacklisted = true;
if(e.blacklisted)
{
- LOG_DEBUG(strcat("The entity '", e.classname, "' is going to be excluded from path finding during this match\n"));
+ LOG_DEBUG("The entity '", e.classname, "' is going to be excluded from path finding during this match");
return;
}
}
nwp = e.nearestwaypoint;
}
- LOG_DEBUG(strcat("-- checking ", e.classname, " (with cost ", ftos(nwp.wpcost), ")\n"));
+ LOG_DEBUG("-- checking ", e.classname, " (with cost ", ftos(nwp.wpcost), ")");
if (nwp)
if (nwp.wpcost < 10000000)
{
//te_wizspike(nwp.wpnearestpoint);
- LOG_DEBUG(strcat(e.classname, " ", ftos(f), "/(1+", ftos((nwp.wpcost + vlen(e.origin - nwp.wpnearestpoint))), "/", ftos(rangebias), ") = "));
+ LOG_DEBUG(e.classname, " ", ftos(f), "/(1+", ftos((nwp.wpcost + vlen(e.origin - nwp.wpnearestpoint))), "/", ftos(rangebias), ") = ");
f = f * rangebias / (rangebias + (nwp.wpcost + vlen(o - nwp.wpnearestpoint)));
- LOG_DEBUG(strcat("considering ", e.classname, " (with rating ", ftos(f), ")\n"));
+ LOG_DEBUG("considering ", e.classname, " (with rating ", ftos(f), ")");
if (navigation_bestrating < f)
{
- LOG_DEBUG(strcat("ground path: added goal ", e.classname, " (with rating ", ftos(f), ")\n"));
+ LOG_DEBUG("ground path: added goal ", e.classname, " (with rating ", ftos(f), ")");
navigation_bestrating = f;
navigation_bestgoal = e;
}
if(checkpvs(this.origin + this.view_ofs, this.goalstack01))
if(tracewalk(this, this.origin, this.mins, this.maxs, (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5, bot_navigation_movemode))
{
- LOG_DEBUG(strcat("path optimized for ", this.netname, ", removed a goal from the queue\n"));
+ LOG_DEBUG("path optimized for ", this.netname, ", removed a goal from the queue");
navigation_poproute(this);
// TODO this may also be a nice idea to do "early" (e.g. by
// manipulating the vlen() comparisons) to shorten paths in
return;
navigation_routetogoal(this, navigation_bestgoal, this.origin);
- LOG_DEBUG(strcat("best goal ", this.goalcurrent.classname , "\n"));
+ LOG_DEBUG("best goal ", this.goalcurrent.classname);
// If the bot got stuck then try to reach the farthest waypoint
if (!this.navigation_hasgoals)
{
if (!(this.aistatus & AI_STATUS_STUCK))
{
- LOG_DEBUG(strcat(this.netname, " cannot walk to any goal\n"));
+ LOG_DEBUG(this.netname, " cannot walk to any goal");
this.aistatus |= AI_STATUS_STUCK;
}
if (!bot_waypoint_queue_owner)
{
- LOG_DEBUG(strcat(this.netname, " sutck, taking over the waypoints queue\n"));
+ LOG_DEBUG(this.netname, " sutck, taking over the waypoints queue");
bot_waypoint_queue_owner = this;
bot_waypoint_queue_bestgoal = NULL;
bot_waypoint_queue_bestgoalrating = 0;
{
// evaluate the next goal on the queue
float d = vlen(this.origin - bot_waypoint_queue_goal.origin);
- LOG_DEBUG(strcat(this.netname, " evaluating ", bot_waypoint_queue_goal.classname, " with distance ", ftos(d), "\n"));
+ LOG_DEBUG(this.netname, " evaluating ", bot_waypoint_queue_goal.classname, " with distance ", ftos(d));
if(tracewalk(bot_waypoint_queue_goal, this.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), bot_waypoint_queue_goal.origin, bot_navigation_movemode))
{
if( d > bot_waypoint_queue_bestgoalrating)
{
if (bot_waypoint_queue_bestgoal)
{
- LOG_DEBUG(strcat(this.netname, " stuck, reachable waypoint found, heading to it\n"));
+ LOG_DEBUG(this.netname, " stuck, reachable waypoint found, heading to it");
navigation_routetogoal(this, bot_waypoint_queue_bestgoal, this.origin);
this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
this.aistatus &= ~AI_STATUS_STUCK;
}
else
{
- LOG_DEBUG(strcat(this.netname, " stuck, cannot walk to any waypoint at all\n"));
+ LOG_DEBUG(this.netname, " stuck, cannot walk to any waypoint at all");
}
bot_waypoint_queue_owner = NULL;
return;
// build a new queue
- LOG_DEBUG(strcat(this.netname, " stuck, scanning reachable waypoints within ", ftos(search_radius)," qu\n"));
+ LOG_DEBUG(this.netname, " stuck, scanning reachable waypoints within ", ftos(search_radius)," qu");
entity first = NULL;
bot_waypoint_queue_goal = first;
else
{
- LOG_DEBUG(strcat(this.netname, " stuck, cannot walk to any waypoint at all\n"));
+ LOG_DEBUG(this.netname, " stuck, cannot walk to any waypoint at all");
bot_waypoint_queue_owner = NULL;
}
}
return;
buf_del(bot.bot_cmdqueuebuf);
bot.bot_cmdqueuebuf_allocated = false;
- LOG_TRACE("bot ", bot.netname, " queue cleared\n");
+ LOG_TRACE("bot ", bot.netname, " queue cleared");
}
void bot_queuecommand(entity bot, string cmdstring)
{
if(!(f & WAYPOINTFLAG_GENERATED))
{
- LOG_TRACE("Killed a waypoint that was stuck in solid at ", vtos(w.origin), "\n");
+ LOG_TRACE("Killed a waypoint that was stuck in solid at ", vtos(w.origin));
delete(w);
return NULL;
}
{
LOG_TRACE("waypoint links load from ");
LOG_TRACE(filename);
- LOG_TRACE(" failed\n");
+ LOG_TRACE(" failed");
return false;
}
if(!found)
{
- LOG_TRACE("waypoint_load_links: couldn't find 'from' waypoint at ", vtos(wp_from.origin),"\n");
+ LOG_TRACE("waypoint_load_links: couldn't find 'from' waypoint at ", vtos(wp_from.origin));
continue;
}
if(!found)
{
- LOG_TRACE("waypoint_load_links: couldn't find 'to' waypoint at ", vtos(wp_to.origin),"\n");
+ LOG_TRACE("waypoint_load_links: couldn't find 'to' waypoint at ", vtos(wp_to.origin));
continue;
}
fclose(file);
- LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.cache\n");
+ LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.cache");
botframe_cachedwaypointlinks = true;
return true;
if (file < 0)
{
- LOG_TRACE("waypoint links load from ", filename, " failed\n");
+ LOG_TRACE("waypoint links load from ", filename, " failed");
return;
}
fclose(file);
- LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.hardwired\n");
+ LOG_TRACE("loaded ", ftos(c), " waypoint links from maps/", mapname, ".waypoints.hardwired");
}
entity waypoint_get_link(entity w, float i)
cwb = cwb + 1;
}
fclose(file);
- LOG_TRACE("loaded ", ftos(cwp), " waypoints and ", ftos(cwb), " wayboxes from maps/", mapname, ".waypoints\n");
+ LOG_TRACE("loaded ", ftos(cwp), " waypoints and ", ftos(cwb), " wayboxes from maps/", mapname, ".waypoints");
}
else
{
- LOG_TRACE("waypoint load from ", filename, " failed\n");
+ LOG_TRACE("waypoint load from ", filename, " failed");
}
return cwp + cwb;
}
if(campaign_won && campaign_entries < 2)
{
// last map won!
- LOG_DEBUG("^2test run: campaign looks GOOD\n");
+ LOG_DEBUG("^2test run: campaign looks GOOD");
localcmd("togglemenu 1\n");
CampaignFile_Unload();
return;
c = trace_endpos;
}
- if (n > 200) LOG_TRACE("HOLY SHIT! FullTraceFraction: ", ftos(n), " total traces, ", ftos(m), " iterations\n");
+ if (n > 200) LOG_TRACE("HOLY SHIT! FullTraceFraction: ", ftos(n), " total traces, ", ftos(m), " iterations");
return white / (black + white);
}
}
successful = strcat(successful, (successful ? ", " : ""), client.netname);
- LOG_TRACE("Message sent to ", client.netname, "\n");
+ LOG_TRACE("Message sent to ", client.netname);
continue;
}
if(c == 50)
{
- LOG_TRACE("HOLY SHIT! When tracing from ", vtos(v1), " to ", vtos(v2), "\n");
- LOG_TRACE(" Nudging gets us nowhere at ", vtos(pos), "\n");
- LOG_TRACE(" trace_endpos is ", vtos(trace_endpos), "\n");
- LOG_TRACE(" trace distance is ", ftos(vlen(pos - trace_endpos)), "\n");
+ LOG_TRACE("HOLY SHIT! When tracing from ", vtos(v1), " to ", vtos(v2));
+ LOG_TRACE(" Nudging gets us nowhere at ", vtos(pos));
+ LOG_TRACE(" trace_endpos is ", vtos(trace_endpos));
+ LOG_TRACE(" trace distance is ", ftos(vlen(pos - trace_endpos)));
}
stopentity = trace_ent;
LOG_TRACE("checkwp "); LOG_TRACE(map);
if(!fexists(strcat("maps/", map, ".waypoints")))
{
- LOG_TRACE(": no waypoints\n");
+ LOG_TRACE(": no waypoints");
return false;
}
- LOG_TRACE(": has waypoints\n");
+ LOG_TRACE(": has waypoints");
}
// open map size restriction file
fclose(fh);
if(player_count < mapmin)
{
- LOG_TRACE("not enough\n");
+ LOG_TRACE("not enough");
return false;
}
if(player_count > mapmax)
{
- LOG_TRACE("too many\n");
+ LOG_TRACE("too many");
return false;
}
- LOG_TRACE("right size\n");
+ LOG_TRACE("right size");
return true;
}
- LOG_TRACE(": not found\n");
+ LOG_TRACE(": not found");
return true;
}
return 0;
}
else
- LOG_DEBUG( "Couldn't select '", filename, "'...\n" );
+ LOG_DEBUG( "Couldn't select '", filename, "'..." );
return 0;
}
{
float pass, i;
- LOG_TRACE("Trying MaplistMethod_Iterate\n");
+ LOG_TRACE("Trying MaplistMethod_Iterate");
for(pass = 1; pass <= 2; ++pass)
{
float() MaplistMethod_Repeat = // fallback method
{
- LOG_TRACE("Trying MaplistMethod_Repeat\n");
+ LOG_TRACE("Trying MaplistMethod_Repeat");
if(Map_Check(Map_Current, 2))
return Map_Current;
{
float i, imax;
- LOG_TRACE("Trying MaplistMethod_Random\n");
+ LOG_TRACE("Trying MaplistMethod_Random");
imax = 42;
{
float i, j, imax, insertpos;
- LOG_TRACE("Trying MaplistMethod_Shuffle\n");
+ LOG_TRACE("Trying MaplistMethod_Shuffle");
imax = 42;
insertpos = pow(random(), 1 / exponent); // ]0, 1]
insertpos = insertpos * (Map_Count - 1); // ]0, Map_Count - 1]
insertpos = ceil(insertpos) + 1; // {2, 3, 4, ..., Map_Count}
- LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos), "\n");
+ LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos));
// insert the current map there
newlist = "";
if(world_initialized > 0)
{
world_initialized = 0;
- LOG_TRACE("Saving persistent data...\n");
+ LOG_TRACE("Saving persistent data...");
Ban_SaveBans();
// playerstats with unfinished match
CheatShutdown(); // must be after cheatcount check
db_close(ServerProgsDB);
db_close(TemporaryDB);
- LOG_TRACE("Saving persistent data... done!\n");
+ LOG_TRACE("Saving persistent data... done!");
// tell the bot system the game is ending now
bot_endgame();
LOG_TRACE("received ban list item ", ftos(i / 4), ": ip=", ip);
LOG_TRACE(" timeleft=", ftos(timeleft), " reason=", reason);
- LOG_TRACE(" serverip=", serverip, "\n");
+ LOG_TRACE(" serverip=", serverip);
timeleft -= 1.5 * autocvar_g_ban_sync_timeout;
if(timeleft < 0)
if(time + bantime > ban_expire[i])
{
ban_expire[i] = time + bantime;
- LOG_TRACE(ip, "'s ban has been prolonged to ", ftos(bantime), " seconds from now\n");
+ LOG_TRACE(ip, "'s ban has been prolonged to ", ftos(bantime), " seconds from now");
}
else
- LOG_TRACE(ip, "'s ban is still active until ", ftos(ban_expire[i] - time), " seconds from now\n");
+ LOG_TRACE(ip, "'s ban is still active until ", ftos(ban_expire[i] - time), " seconds from now");
// and enforce
reason = Ban_Enforce(i, reason);
}
// okay, insert our new victim as i
Ban_Delete(i);
- LOG_TRACE(ip, " has been banned for ", ftos(bantime), " seconds\n");
+ LOG_TRACE(ip, " has been banned for ", ftos(bantime), " seconds");
ban_expire[i] = time + bantime;
ban_ip[i] = strzone(ip);
ban_count = max(ban_count, i + 1);
{
LOG_TRACE("Nearest point (");
LOG_TRACE(nearest_entity[0].netname);
- LOG_TRACE(") is not visible, using a visible one.\n");
+ LOG_TRACE(") is not visible, using a visible one.");
}
return nearest_entity[i];
}
if (num_nearest == 0)
return NULL;
- LOG_TRACE("Not seeing any location point, using nearest as fallback.\n");
+ LOG_TRACE("Not seeing any location point, using nearest as fallback.");
/* DEBUGGING CODE:
dprint("Candidates were: ");
for(j = 0; j < num_nearest; ++j)
traceline(this.origin - tic, this.origin + tic, MOVE_NORMAL, this);
if (trace_fraction >= 1)
{
- LOG_TRACE("Odd... did not hit...?\n");
+ LOG_TRACE("Odd... did not hit...?");
}
else if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
{
- LOG_TRACE("Detected and prevented the sky-grapple bug.\n");
+ LOG_TRACE("Detected and prevented the sky-grapple bug.");
return true;
}
}
{
setorigin(e, start);
e.angles = vectoangles(end - start);
- LOG_TRACE("Needed ", ftos(i + 1), " attempts\n");
+ LOG_TRACE("Needed ", ftos(i + 1), " attempts");
return true;
}
else
{
pickup_dropped_score = (autocvar_g_ctf_flag_return_time ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_return_time) - time) / autocvar_g_ctf_flag_return_time, 1) : 1);
pickup_dropped_score = floor((autocvar_g_ctf_score_pickup_dropped_late * (1 - pickup_dropped_score) + autocvar_g_ctf_score_pickup_dropped_early * pickup_dropped_score) + 0.5);
- LOG_TRACE("pickup_dropped_score is ", ftos(pickup_dropped_score), "\n");
+ LOG_TRACE("pickup_dropped_score is ", ftos(pickup_dropped_score));
PlayerTeamScore_AddScore(player, pickup_dropped_score);
ctf_EventLog("pickup", flag.team, player);
break;
// sanity checks
if(this.mins != CTF_FLAG.m_mins || this.maxs != CTF_FLAG.m_maxs) { // reset the flag boundaries in case it got squished
- LOG_TRACE("wtf the flag got squashed?\n");
+ LOG_TRACE("wtf the flag got squashed?");
tracebox(this.origin, CTF_FLAG.m_mins, CTF_FLAG.m_maxs, this.origin, MOVE_NOMONSTERS, this);
if(!trace_startsolid || this.noalign) // can we resize it without getting stuck?
setsize(this, CTF_FLAG.m_mins, CTF_FLAG.m_maxs); }
default: // this should never happen
{
- LOG_TRACE("ctf_FlagThink(): Flag exists with no status?\n");
+ LOG_TRACE("ctf_FlagThink(): Flag exists with no status?");
return;
}
}
case FLAG_CARRY:
{
- LOG_TRACE("Someone touched a flag even though it was being carried?\n");
+ LOG_TRACE("Someone touched a flag even though it was being carried?");
break;
}
void havocbot_role_ctf_setrole(entity bot, int role)
{
- LOG_TRACE(strcat(bot.netname," switched to "));
+ string s = "(null)";
switch(role)
{
case HAVOCBOT_CTF_ROLE_CARRIER:
- LOG_TRACE("carrier");
+ s = "carrier";
bot.havocbot_role = havocbot_role_ctf_carrier;
bot.havocbot_role_timeout = 0;
bot.havocbot_cantfindflag = time + 10;
bot.bot_strategytime = 0;
break;
case HAVOCBOT_CTF_ROLE_DEFENSE:
- LOG_TRACE("defense");
+ s = "defense";
bot.havocbot_role = havocbot_role_ctf_defense;
bot.havocbot_role_timeout = 0;
break;
case HAVOCBOT_CTF_ROLE_MIDDLE:
- LOG_TRACE("middle");
+ s = "middle";
bot.havocbot_role = havocbot_role_ctf_middle;
bot.havocbot_role_timeout = 0;
break;
case HAVOCBOT_CTF_ROLE_OFFENSE:
- LOG_TRACE("offense");
+ s = "offense";
bot.havocbot_role = havocbot_role_ctf_offense;
bot.havocbot_role_timeout = 0;
break;
case HAVOCBOT_CTF_ROLE_RETRIEVER:
- LOG_TRACE("retriever");
+ s = "retriever";
bot.havocbot_previous_role = bot.havocbot_role;
bot.havocbot_role = havocbot_role_ctf_retriever;
bot.havocbot_role_timeout = time + 10;
bot.bot_strategytime = 0;
break;
case HAVOCBOT_CTF_ROLE_ESCORT:
- LOG_TRACE("escort");
+ s = "escort";
bot.havocbot_previous_role = bot.havocbot_role;
bot.havocbot_role = havocbot_role_ctf_escort;
bot.havocbot_role_timeout = time + 30;
bot.bot_strategytime = 0;
break;
}
- LOG_TRACE("\n");
+ LOG_TRACE(bot.netname, " switched to ", s);
}
// if no teams are found, spawn defaults
if(find(NULL, classname, "ctf_team") == NULL)
{
- LOG_TRACE("No \"ctf_team\" entities found on this map, creating them anyway.\n");
+ LOG_TRACE("No \"ctf_team\" entities found on this map, creating them anyway.");
if(ctf_teams & BIT(0))
ctf_SpawnTeam("Red", NUM_TEAM_1);
if(ctf_teams & BIT(1))
// if no teams are found, spawn defaults
if(find(NULL, classname, "dom_team") == NULL || autocvar_g_domination_teams_override >= 2)
{
- LOG_TRACE("No \"dom_team\" entities found on this map, creating them anyway.\n");
+ LOG_TRACE("No \"dom_team\" entities found on this map, creating them anyway.");
domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4);
dom_spawnteams(domination_teams);
}
// If only one left on team or if role has timed out then start trying to free players.
if (((unfrozen == 0) && (!STAT(FROZEN, this))) || (time > this.havocbot_role_timeout))
{
- LOG_TRACE("changing role to freeing\n");
+ LOG_TRACE("changing role to freeing");
this.havocbot_role = havocbot_role_ft_freeing;
this.havocbot_role_timeout = 0;
return;
if (time > this.havocbot_role_timeout)
{
- LOG_TRACE("changing role to offense\n");
+ LOG_TRACE("changing role to offense");
this.havocbot_role = havocbot_role_ft_offense;
this.havocbot_role_timeout = 0;
return;
if(spawn_point == NULL)
{
- LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations\n");
+ LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations");
entity e = spawn();
setsize(e, (get_monsterinfo(mon)).mins, (get_monsterinfo(mon)).maxs);
if (!(this.kh_next))
{
- LOG_TRACE("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer");
this.havocbot_role = havocbot_role_kh_freelancer;
this.havocbot_role_timeout = 0;
return;
if (this.kh_next)
{
- LOG_TRACE("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier");
this.havocbot_role = havocbot_role_kh_carrier;
this.havocbot_role_timeout = 0;
return;
this.havocbot_role_timeout = time + random() * 10 + 20;
if (time > this.havocbot_role_timeout)
{
- LOG_TRACE("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer");
this.havocbot_role = havocbot_role_kh_freelancer;
this.havocbot_role_timeout = 0;
return;
if (this.kh_next)
{
- LOG_TRACE("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier");
this.havocbot_role = havocbot_role_kh_carrier;
this.havocbot_role_timeout = 0;
return;
this.havocbot_role_timeout = time + random() * 10 + 20;
if (time > this.havocbot_role_timeout)
{
- LOG_TRACE("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer");
this.havocbot_role = havocbot_role_kh_freelancer;
this.havocbot_role_timeout = 0;
return;
if (this.kh_next)
{
- LOG_TRACE("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier");
this.havocbot_role = havocbot_role_kh_carrier;
this.havocbot_role_timeout = 0;
return;
{
if (random() < 0.5)
{
- LOG_TRACE("changing role to offense\n");
+ LOG_TRACE("changing role to offense");
this.havocbot_role = havocbot_role_kh_offense;
}
else
{
- LOG_TRACE("changing role to defense\n");
+ LOG_TRACE("changing role to defense");
this.havocbot_role = havocbot_role_kh_defense;
}
this.havocbot_role_timeout = 0;
{
// SNAFU (maybe a draw game?)
ClearWinners();
- LOG_TRACE("No players, ending game.\n");
+ LOG_TRACE("No players, ending game.");
return WINNING_YES;
}
}
// if no teams are found, spawn defaults
if(find(NULL, classname, "tdm_team") == NULL)
{
- LOG_TRACE("No \"tdm_team\" entities found on this map, creating them anyway.\n");
+ LOG_TRACE("No \"tdm_team\" entities found on this map, creating them anyway.");
int numteams = autocvar_g_tdm_teams_override;
if(inwater(parent.origin))
{
- LOG_TRACE("FromWater\n");
+ LOG_TRACE("FromWater");
pathlib_expandnode = pathlib_expandnode_box;
pathlib_movenode = pathlib_swimnode;
}
{
if(inwater(to))
{
- LOG_TRACE("ToWater\n");
+ LOG_TRACE("ToWater");
pathlib_expandnode = pathlib_expandnode_box;
pathlib_movenode = pathlib_walknode;
}
else
{
- LOG_TRACE("LandToLoand\n");
+ LOG_TRACE("LandToLoand");
//if(edge_check(parent.origin))
// return 0;
node = pathlib_nodeatpoint(to);
if(node)
{
- LOG_TRACE("NodeAtPoint\n");
+ LOG_TRACE("NodeAtPoint");
++pathlib_merge_cnt;
if(node.owner == openlist)
{
//pathlib_showsquare(where, 0 ,30);
//pathlib_showsquare(parent.origin, 1 ,30);
- LOG_TRACE("pathlib_movenode_goodnode = 0\n");
+ LOG_TRACE("pathlib_movenode_goodnode = 0");
return 0;
}
if(pathlib_nodeatpoint(where))
{
- LOG_TRACE("NAP WHERE :",vtos(where),"\n");
- LOG_TRACE("not NAP TO:",vtos(to),"\n");
- LOG_TRACE("NAP-NNAP:",ftos(vlen(to-where)),"\n\n");
+ LOG_TRACE("NAP WHERE :",vtos(where));
+ LOG_TRACE("not NAP TO:",vtos(to));
+ LOG_TRACE("NAP-NNAP:",ftos(vlen(to-where)));
return 0;
}
if(doedge)
if (!tile_check(parent, where))
{
- LOG_TRACE("tile_check fail\n");
+ LOG_TRACE("tile_check fail");
#if DEBUGPATHING
pathlib_showsquare(where, 0 ,30);
#endif
if(node.owner == closedlist)
{
- LOG_TRACE("Pathlib: Tried to close a closed node!\n");
+ LOG_TRACE("Pathlib: Tried to close a closed node!");
return;
}
to.y = fsnap(to.y, pathlib_gridsize);
//to_z += 32;
- LOG_TRACE("AStar init\n");
+ LOG_TRACE("AStar init");
path = pathlib_mknode(from, NULL);
pathlib_close_node(path, to);
if(pathlib_foundgoal)
{
- LOG_TRACE("AStar: Goal found on first node!\n");
+ LOG_TRACE("AStar: Goal found on first node!");
open = new(path_end);
open.owner = open;
if(pathlib_expandnode(path, from, to) <= 0)
{
- LOG_TRACE("AStar path fail.\n");
+ LOG_TRACE("AStar path fail.");
pathlib_cleanup();
return NULL;
{
if((gettime(GETTIME_REALTIME) - pathlib_starttime) > pathlib_maxtime)
{
- LOG_TRACE("Path took to long to compute!\n");
- LOG_TRACE("Nodes - created: ", ftos(pathlib_made_cnt),"\n");
- LOG_TRACE("Nodes - open: ", ftos(pathlib_open_cnt),"\n");
- LOG_TRACE("Nodes - merged: ", ftos(pathlib_merge_cnt),"\n");
- LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
+ LOG_TRACE("Path took to long to compute!");
+ LOG_TRACE("Nodes - created: ", ftos(pathlib_made_cnt));
+ LOG_TRACE("Nodes - open: ", ftos(pathlib_open_cnt));
+ LOG_TRACE("Nodes - merged: ", ftos(pathlib_merge_cnt));
+ LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt));
pathlib_cleanup();
return NULL;
if(pathlib_foundgoal)
{
- LOG_TRACE("Target found. Rebuilding and filtering path...\n");
+ LOG_TRACE("Target found. Rebuilding and filtering path...");
ftime = gettime(GETTIME_REALTIME);
ptime = ftime - ptime;
#if DEBUGPATHING
pathlib_showpath2(start);
- LOG_TRACE("Time used - pathfinding: ", ftos(ptime),"\n");
- LOG_TRACE("Time used - rebuild & filter: ", ftos(ftime),"\n");
- LOG_TRACE("Time used - cleanup: ", ftos(ctime),"\n");
- LOG_TRACE("Time used - total: ", ftos(ptime + ftime + ctime),"\n");
- LOG_TRACE("Time used - # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_frametime)),"\n\n");
- LOG_TRACE("Nodes - created: ", ftos(pathlib_made_cnt),"\n");
- LOG_TRACE("Nodes - open: ", ftos(pathlib_open_cnt),"\n");
- LOG_TRACE("Nodes - merged: ", ftos(pathlib_merge_cnt),"\n");
- LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
- LOG_TRACE("Nodes - searched: ", ftos(pathlib_searched_cnt),"\n");
- LOG_TRACE("Nodes bestopen searched: ", ftos(pathlib_bestopen_searched),"\n");
- LOG_TRACE("Nodes bestcash - hits: ", ftos(pathlib_bestcash_hits),"\n");
- LOG_TRACE("Nodes bestcash - save: ", ftos(pathlib_bestcash_saved),"\n");
- LOG_TRACE("AStar done.\n");
+ LOG_TRACE("Time used - pathfinding: ", ftos(ptime));
+ LOG_TRACE("Time used - rebuild & filter: ", ftos(ftime));
+ LOG_TRACE("Time used - cleanup: ", ftos(ctime));
+ LOG_TRACE("Time used - total: ", ftos(ptime + ftime + ctime));
+ LOG_TRACE("Time used - # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_frametime)));
+ LOG_TRACE("Nodes - created: ", ftos(pathlib_made_cnt));
+ LOG_TRACE("Nodes - open: ", ftos(pathlib_open_cnt));
+ LOG_TRACE("Nodes - merged: ", ftos(pathlib_merge_cnt));
+ LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt));
+ LOG_TRACE("Nodes - searched: ", ftos(pathlib_searched_cnt));
+ LOG_TRACE("Nodes bestopen searched: ", ftos(pathlib_bestopen_searched));
+ LOG_TRACE("Nodes bestcash - hits: ", ftos(pathlib_bestcash_hits));
+ LOG_TRACE("Nodes bestcash - save: ", ftos(pathlib_bestcash_saved));
+ LOG_TRACE("AStar done.");
#endif
return start;
}
}
- LOG_TRACE("A* Faild to find a path! Try a smaller gridsize.\n");
+ LOG_TRACE("A* Faild to find a path! Try a smaller gridsize.");
pathlib_cleanup();
vector direction,point,last_point,s,e;
float steps, distance, i;
- LOG_TRACE("Walking node from ", vtos(start), " to ", vtos(end), "\n");
+ LOG_TRACE("Walking node from ", vtos(start), " to ", vtos(end));
pathlib_movenode_goodnode = 0;
//start - movenode_maxdrop
a.cnt = time + 10;
- LOG_TRACE("I cant walk on air!\n");
+ LOG_TRACE("I cant walk on air!");
return trace_endpos;
}
pathlib_searched_cnt = 0;
pathlib_foundgoal = false;
- LOG_TRACE("pathlib_waypointpath init\n");
+ LOG_TRACE("pathlib_waypointpath init");
// Initialize waypoint grid
IL_EACH(g_waypoints, true,
start_node = wp_from;
start_node.pathlib_list = closedlist;
- LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(start_node))," links\n");
+ LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(start_node))," links");
if(pathlib_open_cnt <= 0)
{
- LOG_TRACE("pathlib_waypointpath: Start waypoint not linked! aborting.\n");
+ LOG_TRACE("pathlib_waypointpath: Start waypoint not linked! aborting.");
return NULL;
}
n = pathlib_wpp_bestopen();
if(!n)
{
- LOG_TRACE("Cannot find best open node, abort.\n");
+ LOG_TRACE("Cannot find best open node, abort.");
return NULL;
}
pathlib_wpp_close(n);
- LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(n))," links\n");
+ LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(n))," links");
if(pathlib_foundgoal)
{
entity start, end, open, ln;
- LOG_TRACE("Target found. Rebuilding and filtering path...\n");
+ LOG_TRACE("Target found. Rebuilding and filtering path...");
buildpath_nodefilter = buildpath_nodefilter_none;
start = path_build(NULL, start_node.origin, NULL, NULL);
if(!found)
{
- LOG_TRACE("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target, "\n");
+ LOG_TRACE("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target);
return '-1 0 0';
}
}
switch (this.state)
{
default:
- LOG_WARNF("unhandled weaponentity (%i) state for player (%i): %d\n", this, actor, this.state);
+ LOG_WARNF("unhandled weaponentity (%i) state for player (%i): %d", this, actor, this.state);
break;
case WS_INUSE:
case WS_RAISE: