From 89102c17c712c26691a2f34f8a58721f91c29c0d Mon Sep 17 00:00:00 2001 From: Adam Olsen Date: Mon, 13 Aug 2001 21:25:26 +0000 Subject: [PATCH] Start initializing things. Should work, but causes trouble, so the offending code is commented out. --- client.qc | 2 ++ spawn.qc | 21 +++++++++++++++++++++ spawn.qh | 1 + spectate.qc | 2 ++ 4 files changed, 26 insertions(+) diff --git a/client.qc b/client.qc index 1d759a2..c61fcb7 100644 --- a/client.qc +++ b/client.qc @@ -3065,6 +3065,8 @@ void() ClientConnect = { local string st; + initentity (self); + bprint (PRINT_HIGH, self.netname); bprint (PRINT_HIGH, " has joined the server\n"); diff --git a/spawn.qc b/spawn.qc index 53248ad..403f276 100644 --- a/spawn.qc +++ b/spawn.qc @@ -1,10 +1,31 @@ +#include "defs.qh" + entity () real_spawn; +void (entity ent) initentity; entity () spawn = { local entity ent; ent = real_spawn (); + initentity (ent); return ent; }; + +void (entity ent) initentity = +{ + ent.classname = ""; + ent.netname = ""; + ent.targetname = ""; + ent.target = ""; + ent.team_str_home = ""; + ent.flame_id = ""; + ent.group = ""; + ent.message = ""; + +// self.solid = SOLID_NOT; +// self.movetype = MOVETYPE_NONE; +// setmodel (self, ""); +// ent.model = ""; +}; diff --git a/spawn.qh b/spawn.qh index 7f36238..5ae7f96 100644 --- a/spawn.qh +++ b/spawn.qh @@ -1 +1,2 @@ entity () spawn; +void (entity ent) initentity; diff --git a/spectate.qc b/spectate.qc index ed8f57b..61cb9ad 100644 --- a/spectate.qc +++ b/spectate.qc @@ -19,6 +19,8 @@ called when a spectator connects to a server */ void() SpectatorConnect = { + initentity (self); + bprint (PRINT_MEDIUM, "Spectator "); bprint (PRINT_MEDIUM, self.netname); bprint (PRINT_MEDIUM, " connected\n");