From 7509200287cda96baf39711f4921ca61b8c2b1a6 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sat, 14 Sep 2024 00:31:21 +0300 Subject: [PATCH] game: code cleanup --- src/game/g_utils.c | 8 +++++--- src/game/header/local.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/game/g_utils.c b/src/game/g_utils.c index ff076f59..388487fc 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -66,7 +66,7 @@ G_ProjectSource2(vec3_t point, vec3_t distance, vec3_t forward, * if the end of the list is reached. */ edict_t * -G_Find(edict_t *from, int fieldofs, char *match) +G_Find(edict_t *from, int fieldofs, const char *match) { char *s; @@ -409,7 +409,7 @@ G_UseTargets(edict_t *ent, edict_t *activator) if (t == ent) { - gi.dprintf("WARNING: Entity used itself.\n"); + gi.dprintf ("WARNING: %s used itself.\n", t->classname); } else { @@ -771,7 +771,9 @@ G_Spawn(void) edict_t *e = G_SpawnOptional(); if (!e) - gi.error ("ED_Alloc: no free edicts"); + { + gi.error("%s: no free edicts", __func__); + } return e; } diff --git a/src/game/header/local.h b/src/game/header/local.h index 7b5004d4..23a2a126 100644 --- a/src/game/header/local.h +++ b/src/game/header/local.h @@ -765,7 +765,7 @@ void Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, qboolean KillBox(edict_t *ent); void G_ProjectSource(vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result); -edict_t *G_Find(edict_t *from, int fieldofs, char *match); +edict_t *G_Find(edict_t *from, int fieldofs, const char *match); edict_t *findradius(edict_t *from, vec3_t org, float rad); edict_t *G_PickTarget(char *targetname); void G_UseTargets(edict_t *ent, edict_t *activator);