// point the string back at updateclient->name to keep it safe
strlcpy (host_client->playermodel, newPath, sizeof (host_client->playermodel));
- host_client->edict->v->playermodel = PR_SetString(host_client->playermodel);
+ if( eval_playermodel )
+ GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PR_SetString(host_client->playermodel);
if (strcmp(host_client->old_model, host_client->playermodel))
{
if (host_client->spawned)
// point the string back at updateclient->name to keep it safe
strlcpy (host_client->playerskin, newPath, sizeof (host_client->playerskin));
- host_client->edict->v->playerskin = PR_SetString(host_client->playerskin);
+ if( eval_playerskin )
+ GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PR_SetString(host_client->playerskin);
if (strcmp(host_client->old_skin, host_client->playerskin))
{
if (host_client->spawned)
int eval_cursor_trace_endpos;
int eval_cursor_trace_ent;
int eval_colormod;
+int eval_playermodel;
+int eval_playerskin;
mfunction_t *SV_PlayerPhysicsQC;
mfunction_t *EndFrameQC;
eval_cursor_trace_endpos = FindFieldOffset("cursor_trace_endpos");
eval_cursor_trace_ent = FindFieldOffset("cursor_trace_ent");
eval_colormod = FindFieldOffset("colormod");
+ eval_playermodel = FindFieldOffset("playermodel");
+ eval_playerskin = FindFieldOffset("playerskin");
// LordHavoc: allowing QuakeC to override the player movement code
SV_PlayerPhysicsQC = ED_FindFunction ("SV_PlayerPhysics");
if ((val = GETEDICTFIELDVALUE(e, eval_clientcolors)))
val->_float = svs.clients[num].colors;
// NEXUIZ_PLAYERMODEL and NEXUIZ_PLAYERSKIN
- e->v->playermodel = PR_SetString(svs.clients[num].playermodel);
- e->v->playerskin = PR_SetString(svs.clients[num].playerskin);
+ if( eval_playermodel )
+ GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PR_SetString(svs.clients[num].playermodel);
+ if( eval_playerskin )
+ GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PR_SetString(svs.clients[num].playerskin);
}
}
Con_DPrintf("ED_ParseEpair: Can't find field %s\n", s);
return false;
}
- //val->_int = G_INT(def->ofs); AK Please check this - seems to be an org. quake bug
+ //val->_int = G_INT(def->ofs); // AK Please check this - seems to be an org. quake bug
val->_int = def->ofs;
break;
string_t noise1;
string_t noise2;
string_t noise3;
- string_t playermodel;
- string_t playerskin;
} entvars_t;
#define PROGHEADER_CRC 5927
extern int eval_cursor_trace_endpos;
extern int eval_cursor_trace_ent;
extern int eval_colormod;
+extern int eval_playermodel;
+extern int eval_playerskin;
#define GETEDICTFIELDVALUE(ed, fieldoffset) (fieldoffset ? (eval_t *)((qbyte *)ed->v + fieldoffset) : NULL)
}
// NEXUIZ_PLAYERMODEL
- model = PR_GetString(host_client->edict->v->playermodel);
- if (model == NULL)
- model = "";
- // always point the string back at host_client->name to keep it safe
- strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
- host_client->edict->v->playermodel = PR_SetString(host_client->playermodel);
+ if( eval_playermodel ) {
+ model = PR_GetString(GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string);
+ if (model == NULL)
+ model = "";
+ // always point the string back at host_client->name to keep it safe
+ strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
+ GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PR_SetString(host_client->playermodel);
+ }
// NEXUIZ_PLAYERSKIN
- skin = PR_GetString(host_client->edict->v->playerskin);
- if (skin == NULL)
- skin = "";
- // always point the string back at host_client->name to keep it safe
- strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
- host_client->edict->v->playerskin = PR_SetString(host_client->playerskin);
+ if( eval_playerskin ) {
+ skin = PR_GetString(GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string);
+ if (skin == NULL)
+ skin = "";
+ // always point the string back at host_client->name to keep it safe
+ strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
+ GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PR_SetString(host_client->playerskin);
+ }
// frags
host_client->frags = (int)host_client->edict->v->frags;
|| strncasecmp(s, "pmodel", 6) == 0
|| strncasecmp(s, "rate", 4) == 0
|| strncasecmp(s, "playermodel", 11) == 0
- || strncasecmp(s, "playerskin", 10) == 00
+ || strncasecmp(s, "playerskin", 10) == 0
|| (gamemode == GAME_NEHAHRA && (strncasecmp(s, "max", 3) == 0 || strncasecmp(s, "monster", 7) == 0 || strncasecmp(s, "scrag", 5) == 0 || strncasecmp(s, "gimme", 5) == 0 || strncasecmp(s, "wraith", 6) == 0))
|| (gamemode != GAME_NEHAHRA && (strncasecmp(s, "god", 3) == 0 || strncasecmp(s, "notarget", 8) == 0 || strncasecmp(s, "fly", 3) == 0 || strncasecmp(s, "give", 4) == 0 || strncasecmp(s, "noclip", 6) == 0)))
Cmd_ExecuteString (s, src_client);