diff --git a/src/action/a_cmds.c b/src/action/a_cmds.c index a049b84e2..e556b14e3 100644 --- a/src/action/a_cmds.c +++ b/src/action/a_cmds.c @@ -850,7 +850,9 @@ void Cmd_Bandage_f(edict_t *ent) if(ent->client->quad_framenum > level.framenum) damage *= 1.5f; - fire_grenade2(ent, ent->s.origin, vec3_origin, damage, 0, 2 * HZ, damage * 2, false); + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); + fire_grenade2(ent, ent->s.origin, non_const_origin, damage, 0, 2 * HZ, damage * 2, false); INV_AMMO(ent, GRENADE_NUM)--; if (INV_AMMO(ent, GRENADE_NUM) <= 0) { diff --git a/src/action/a_team.c b/src/action/a_team.c index 0cd2244af..8bc72a42f 100644 --- a/src/action/a_team.c +++ b/src/action/a_team.c @@ -1208,7 +1208,10 @@ void killPlayer( edict_t *ent, qboolean suicidePunish ) ent->flags &= ~FL_GODMODE; ent->health = 0; meansOfDeath = MOD_SUICIDE; - player_die(ent, ent, ent, damage, vec3_origin); + + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); + player_die(ent, ent, ent, damage, non_const_origin); ent->deadflag = DEAD_DEAD; } diff --git a/src/action/acesrc/acebot_spawn.c b/src/action/acesrc/acebot_spawn.c index 4175d9aa9..3c1fde943 100644 --- a/src/action/acesrc/acebot_spawn.c +++ b/src/action/acesrc/acebot_spawn.c @@ -691,7 +691,9 @@ void ACESP_RemoveBot(char *name) if( bot->is_bot && (remove_all || !strlen(name) || Q_stricmp(bot->client->pers.netname,name)==0 || (find_team && bot->client->resp.team==find_team)) ) { bot->health = 0; - player_die (bot, bot, bot, 100000, vec3_origin); + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); + player_die (bot, bot, bot, 100000, non_const_origin); // don't even bother waiting for death frames // bot->deadflag = DEAD_DEAD; // bot->inuse = false; diff --git a/src/action/cgf_sfx_glass.c b/src/action/cgf_sfx_glass.c index 23ca4490a..6ef92a632 100644 --- a/src/action/cgf_sfx_glass.c +++ b/src/action/cgf_sfx_glass.c @@ -279,8 +279,10 @@ CGF_SFX_ShootBreakableGlass (edict_t * aGlassPane, edict_t * anAttacker, if (destruct) { // break glass (and hurt if doing kick) + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); CGF_SFX_BreakGlass (aGlassPane, anAttacker, 0, aGlassPane->health, - vec3_origin, FRAMETIME); + non_const_origin, FRAMETIME); if (mod == MOD_KICK) { vec3_t bloodorigin; @@ -421,7 +423,9 @@ CGF_SFX_TouchGlass (edict_t * self, edict_t * other, cplane_t * plane, goto knife_and_grenade_handling; // break glass - CGF_SFX_BreakGlass (glass, other, other, glass->health, vec3_origin, + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); + CGF_SFX_BreakGlass (glass, other, other, glass->health, non_const_origin, 3.0f * FRAMETIME); // glass can take care of itself, but the trigger isn't needed anymore G_FreeEdict (self); diff --git a/src/action/g_combat.c b/src/action/g_combat.c index cd0c2737e..01677de54 100644 --- a/src/action/g_combat.c +++ b/src/action/g_combat.c @@ -202,8 +202,7 @@ qboolean CanDamage (edict_t * targ, edict_t * inflictor) Killed ============ */ -void Killed (edict_t * targ, edict_t * inflictor, edict_t * attacker, int damage, - const vec3_t point) +void Killed (edict_t * targ, edict_t * inflictor, edict_t * attacker, int damage, vec3_t point) { if (targ->health < -999) targ->health = -999; @@ -507,8 +506,12 @@ void T_Damage (edict_t * targ, edict_t * inflictor, edict_t * attacker, const ve if (from_top < 2 * HEAD_HEIGHT) { - vec3_t new_point; - VerifyHeadShot(point, dir, HEAD_HEIGHT, new_point); + vec3_t new_point, deconst_point, deconst_dir; + + //De-constify the point and dir + VectorCopy(point, deconst_point); + VectorCopy(dir, deconst_dir); + VerifyHeadShot(deconst_point, deconst_dir, HEAD_HEIGHT, new_point); VectorSubtract(new_point, targ->s.origin, new_point); //gi.cprintf(attacker, PRINT_HIGH, "z: %d y: %d x: %d\n", (int)(targ_maxs2 - new_point[2]),(int)(new_point[1]) , (int)(new_point[0]) ); @@ -843,7 +846,9 @@ void T_Damage (edict_t * targ, edict_t * inflictor, edict_t * attacker, const ve if ((targ->svflags & SVF_MONSTER) || client) targ->flags |= FL_NO_KNOCKBACK; - Killed(targ, inflictor, attacker, take, point); + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); + Killed(targ, inflictor, attacker, take, non_const_origin); return; } } diff --git a/src/action/g_ext.c b/src/action/g_ext.c index 1af961076..2e9c1c686 100644 --- a/src/action/g_ext.c +++ b/src/action/g_ext.c @@ -53,7 +53,7 @@ void(*engine_CvarSync_Set)(int index, const char *name, const char *val); // // optional new entrypoints the engine may want to call edict_t *xerp_ent; -trace_t q_gameabi XERP_trace(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end) +trace_t q_gameabi XERP_trace(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end) { return gi.trace(start, mins, maxs, end, xerp_ent, MASK_PLAYERSOLID); } diff --git a/src/action/g_grapple.c b/src/action/g_grapple.c index a4c7a81b5..58a6630a8 100644 --- a/src/action/g_grapple.c +++ b/src/action/g_grapple.c @@ -310,9 +310,12 @@ void CTFGrappleFire (edict_t *ent, vec3_t g_offset, int damage, int effect) void CTFWeapon_Grapple_Fire (edict_t *ent) { int damage; - + vec3_t non_const_origin; damage = 10; - CTFGrappleFire (ent, vec3_origin, damage, 0); + + // Copy const to non-const + VectorCopy(vec3_origin, non_const_origin); + CTFGrappleFire (ent, non_const_origin, damage, 0); ent->client->ps.gunframe++; } diff --git a/src/action/g_local.h b/src/action/g_local.h index 799000ae2..b5fa02abe 100644 --- a/src/action/g_local.h +++ b/src/action/g_local.h @@ -2392,7 +2392,7 @@ void A_ScoreboardMessage( edict_t * ent, edict_t * killer ); //local to g_combat but needed in p_view void SpawnDamage (int type, const vec3_t origin, const vec3_t normal, int damage); void Killed (edict_t * targ, edict_t * inflictor, edict_t * attacker, - int damage, const vec3_t point); + int damage, vec3_t point); void Add_Frag(edict_t * ent, int mod); void Subtract_Frag (edict_t * ent); diff --git a/src/action/g_main.c b/src/action/g_main.c index 8da807901..0808d9c00 100644 --- a/src/action/g_main.c +++ b/src/action/g_main.c @@ -540,7 +540,7 @@ cvar_t *cl_discord_discriminator; cvar_t *cl_discord_username; cvar_t *cl_discord_avatar; -void SpawnEntities (char *mapname, char *entities, char *spawnpoint); +void SpawnEntities (const char *mapname, const char *entities, const char *spawnpoint); void ClientThink (edict_t * ent, usercmd_t * cmd); qboolean ClientConnect (edict_t * ent, char *userinfo); void ClientUserinfoChanged (edict_t * ent, char *userinfo); diff --git a/src/action/g_misc.c b/src/action/g_misc.c index debb6d605..c05887af6 100644 --- a/src/action/g_misc.c +++ b/src/action/g_misc.c @@ -730,7 +730,7 @@ one small chunk per 25 of mass (up to 16). So 800 gives the most. */ void func_explosive_explode (edict_t * self, edict_t * inflictor, - edict_t * attacker, int damage, const vec3_t point) + edict_t * attacker, int damage, vec3_t point) { vec3_t origin; vec3_t chunkorigin; @@ -799,7 +799,10 @@ func_explosive_explode (edict_t * self, edict_t * inflictor, void func_explosive_use (edict_t * self, edict_t * other, edict_t * activator) { - func_explosive_explode (self, self, other, self->health, vec3_origin); + vec3_t origin; + VectorCopy(vec3_origin, origin); + // This needs to be non-const + func_explosive_explode (self, self, other, self->health, origin); } void diff --git a/src/action/g_spawn.c b/src/action/g_spawn.c index 869bc1dc4..18ee1e71b 100644 --- a/src/action/g_spawn.c +++ b/src/action/g_spawn.c @@ -913,7 +913,7 @@ Creates a server's entity / program execution context by parsing textual entity definitions out of an ent file. ============== */ -void SpawnEntities (char *mapname, const char *entities, const char *spawnpoint) +void SpawnEntities (const char *mapname, const char *entities, const char *spawnpoint) { edict_t *ent = NULL; gclient_t *client; diff --git a/src/action/p_client.c b/src/action/p_client.c index 4d7624452..795bd5533 100644 --- a/src/action/p_client.c +++ b/src/action/p_client.c @@ -1561,7 +1561,9 @@ void player_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage // Reset Grenade Damage to 1.52 when requested: int damrad = use_classic->value ? GRENADE_DAMRAD_CLASSIC : GRENADE_DAMRAD; self->client->ps.gunframe = 0; - fire_grenade2( self, self->s.origin, vec3_origin, damrad, 0, 2 * HZ, damrad * 2, false ); + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); + fire_grenade2( self, self->s.origin, non_const_origin, damrad, 0, 2 * HZ, damrad * 2, false ); } mod = meansOfDeath & ~MOD_FRIENDLY_FIRE; diff --git a/src/action/p_weapon.c b/src/action/p_weapon.c index ed53484ed..698a08d91 100644 --- a/src/action/p_weapon.c +++ b/src/action/p_weapon.c @@ -929,7 +929,9 @@ void Drop_Weapon(edict_t* ent, gitem_t* item) if (ent->client->quad_framenum > level.framenum) damage *= 1.5f; - fire_grenade2(ent, ent->s.origin, vec3_origin, damage, 0, 2 * HZ, damage * 2, false); + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); + fire_grenade2(ent, ent->s.origin, non_const_origin, damage, 0, 2 * HZ, damage * 2, false); INV_AMMO(ent, GRENADE_NUM)--; ent->client->newweapon = GET_ITEM(MK23_NUM); @@ -3748,7 +3750,9 @@ void Weapon_Gas(edict_t* ent) if (is_quad) damage *= 1.5f; - fire_grenade2(ent, ent->s.origin, vec3_origin, damage, 0, 2 * HZ, damage * 2, false); + vec3_t non_const_origin; // Convert to non-const + VectorCopy(vec3_origin, non_const_origin); + fire_grenade2(ent, ent->s.origin, non_const_origin, damage, 0, 2 * HZ, damage * 2, false); INV_AMMO(ent, GRENADE_NUM)--; if (INV_AMMO(ent, GRENADE_NUM) <= 0) diff --git a/src/client/demo.c b/src/client/demo.c index 8a704e839..996f30e44 100644 --- a/src/client/demo.c +++ b/src/client/demo.c @@ -416,8 +416,13 @@ static void CL_Record_f(void) // send the serverdata MSG_WriteByte(svc_serverdata); + #if USE_AQTION + if (cl.csr.extended) + MSG_WriteLong(PROTOCOL_VERSION_AQTION); + #else if (cl.csr.extended) MSG_WriteLong(PROTOCOL_VERSION_EXTENDED); + #endif else MSG_WriteLong(min(cls.serverProtocol, PROTOCOL_VERSION_DEFAULT)); MSG_WriteLong(cl.servercount); @@ -1181,8 +1186,13 @@ demoInfo_t *CL_GetDemoInfo(const char *path, demoInfo_t *info) goto fail; } c = MSG_ReadLong(); + #if USE_AQTION + if (c == PROTOCOL_VERSION_AQTION) { + csr = &cs_remap_new; + #else if (c == PROTOCOL_VERSION_EXTENDED) { csr = &cs_remap_new; + #endif } else if (c < PROTOCOL_VERSION_OLD || c > PROTOCOL_VERSION_DEFAULT) { goto fail; } diff --git a/src/client/parse.c b/src/client/parse.c index d3cc50081..c63d8ef82 100644 --- a/src/client/parse.c +++ b/src/client/parse.c @@ -566,7 +566,7 @@ static void CL_ParseServerData(void) cls.serverProtocol, protocol); } // BIG HACK to let demos from release work with the 3.0x patch!!! - if (protocol == PROTOCOL_VERSION_EXTENDED) { + if (protocol == PROTOCOL_VERSION_EXTENDED || protocol == PROTOCOL_VERSION_AQTION) { cl.csr = cs_remap_new; protocol = PROTOCOL_VERSION_DEFAULT; } else if (protocol < PROTOCOL_VERSION_OLD || protocol > PROTOCOL_VERSION_AQTION) {