Removes and fixes

* fixed typo in lua_qmath
* removed target_score
* removed some unused stuff from g_team.c (still lots more to remove)
This commit is contained in:
Walter Julius Hennecke 2012-11-15 22:51:47 +01:00
parent e561731baa
commit 973b0e2211
4 changed files with 2 additions and 92 deletions

View file

@ -159,7 +159,6 @@ void SP_target_speaker (gentity_t *ent);
void SP_target_print (gentity_t *ent);
void SP_target_laser (gentity_t *self);
void SP_target_character (gentity_t *ent);
void SP_target_score( gentity_t *ent );
void SP_target_teleporter( gentity_t *ent );
void SP_target_relay (gentity_t *ent);
void SP_target_kill (gentity_t *ent);
@ -353,7 +352,6 @@ spawn_t spawns[] = {
{"target_speaker", SP_target_speaker},
{"target_print", SP_target_print},
{"target_laser", SP_target_laser},
{"target_score", SP_target_score},
{"target_teleporter", SP_target_teleporter},
{"target_relay", SP_target_relay},
{"target_kill", SP_target_kill},

View file

@ -168,45 +168,6 @@ void SP_target_delay( gentity_t *ent ) {
trap_LinkEntity(ent);
}
//==========================================================
/*QUAKED target_score (1 0 0) (-8 -8 -8) (8 8 8) TEAMSCORE
-----DESCRIPTION-----
The Activator is given 'count' points.
This is useless in RPG-X
-----SPAWNFLAGS-----
1: TEAMSCORE - points are added to activator's team's score, not the individual
-----KEYS-----
"count" - number of points to add, default 1
*/
void Team_AddScore( int team, int points );
void Use_Target_Score (gentity_t *ent, gentity_t *other, gentity_t *activator) {
if(!activator) return;
if ( ent->spawnflags & 1 )
{
if ( activator->client )
{
Team_AddScore( activator->client->sess.sessionTeam, ent->count );
}
}
else
{
AddScore( activator, ent->count );
}
CalculateRanks( qfalse );
}
void SP_target_score( gentity_t *ent ) {
if ( !ent->count ) {
ent->count = 1;
}
ent->use = Use_Target_Score;
}
//==========================================================
/*QUAKED target_print (1 0 0) (-8 -8 -8) (8 8 8) redteam blueteam private

View file

@ -443,57 +443,8 @@ void Team_DroppedFlagThink(gentity_t *ent)
// Reset Flag will delete this entity
}
void Team_AddScore( int team, int points )
{
teamgame.last_flag_capture = level.time;
teamgame.last_capture_team = team;
// Increase the team's score
level.teamScores[team] += points;
}
/* TODO: unused! remove me? */
int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) {
return 0;
}
int Team_TouchEnemyFlag( gentity_t *ent, gentity_t *other, int team ) {
gclient_t *cl = other->client;
// hey, its not our flag, pick it up
PrintMsg (NULL, "%s" S_COLOR_WHITE " got the %s flag!\n",
other->client->pers.netname, TeamName(team));
AddScore(other, CTF_FLAG_BONUS);
//if (team == TEAM_RED)
//cl->ps.powerups[PW_REDFLAG] = INT_MAX; // flags never expire
//else
//cl->ps.powerups[PW_BORG_ADAPT] = INT_MAX; // flags never expire
cl->pers.teamState.flagsince = level.time;
Team_SetFlagStatus( team, FLAG_TAKEN );
return -1; // Do not respawn this automatically, but do delete it if it was FL_DROPPED
}
int Pickup_Team( gentity_t *ent, gentity_t *other ) {
int team;
gclient_t *cl = other->client;
// figure out what team this flag is
if (strcmp(ent->classname, "team_CTF_redflag") == 0)
team = TEAM_RED;
else if (strcmp(ent->classname, "team_CTF_blueflag") == 0)
team = TEAM_BLUE;
else {
PrintMsg ( other, "Don't know what team the flag is on.\n");
return 0;
}
return ((team == cl->sess.sessionTeam) ?
Team_TouchOurFlag : Team_TouchEnemyFlag)
(ent, other, team);
return 0;
}
/*

View file

@ -283,7 +283,7 @@ static const luaL_Reg lib_qmath[] = {
{"pow", Qmath_Pow},
{"rad", Qmath_Rad},
{"rand", Qmath_Rand},
{"candom", Qmath_Candom},
{"candom", Qmath_Crandom},
{"random", Qmath_Random},
{"irandom", Qmath_Irandom},
{"flrandom", Qmath_FLrandom},