From: Lyberta Date: Tue, 10 Jul 2018 04:06:30 +0000 (+0300) Subject: Merge branch 'master' into Lyberta/TeamplayOverhaul X-Git-Tag: xonotic-v0.8.5~1953^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=69eda62d02bc02ff50547bad514af3f7ce487413;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Lyberta/TeamplayOverhaul --- 69eda62d02bc02ff50547bad514af3f7ce487413 diff --cc qcsrc/server/player.qc index 0b9e36b55,5bd4b5989..3755da963 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@@ -664,6 -666,30 +666,15 @@@ void PlayerDamage(entity this, entity i } } + bool PlayerHeal(entity targ, entity inflictor, float amount, float limit) + { + if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= limit) + return false; + + GiveResourceWithLimit(targ, RESOURCE_HEALTH, amount, limit); + return true; + } + -bool MoveToTeam(entity client, int team_colour, int type) -{ - int lockteams_backup = lockteams; // backup any team lock - lockteams = 0; // disable locked teams - TeamchangeFrags(client); // move the players frags - if (!SetPlayerTeamSimple(client, team_colour)) - { - return false; - } - Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE.m_id, DMG_NOWEP, client.origin, '0 0 0'); // kill the player - lockteams = lockteams_backup; // restore the team lock - LogTeamchange(client.playerid, client.team, type); - return true; -} - /** * message "": do not say, just test flood control * return value: diff --cc qcsrc/server/player.qh index 8d6bc51ae,8c9bac9b6..1c38a9fbe --- a/qcsrc/server/player.qh +++ b/qcsrc/server/player.qh @@@ -30,6 -30,15 +30,8 @@@ void calculate_player_respawn_time(enti void ClientKill_Now_TeamChange(entity this); -/// \brief Moves player to the specified team. -/// \param[in,out] client Client to move. -/// \param[in] team_colour Color of the team. -/// \param[in] type ??? -/// \return True on success, false otherwise. -bool MoveToTeam(entity client, float team_colour, float type); - void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force); + bool PlayerHeal(entity targ, entity inflictor, float amount, float limit); + int Say(entity source, float teamsay, entity privatesay, string msgin, float floodcontrol);