Skip to content

Commit

Permalink
Server: Use Co-Op Quick Revive Price properly
Browse files Browse the repository at this point in the history
  • Loading branch information
MotoLegacy committed May 18, 2022
1 parent f25b8db commit 63a0799
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions source/server/entities/machines.qc
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,21 @@ void() touch_perk =

// Don't prompt if our hands or busy or we already have the perk
if (!(other.perks & self.style) && other.fire_delay < time && self.revivesoda < 3) {
float price;

// Check if this is Quick Revive and we are playing in Co-Op,
// adjust price if so.
if (self.classname == "perk_revive" && player_count > 1)
price = self.cost2;
// Nope, use normal cost.
else
price = self.cost;

// sequence = perk ID in client
useprint(other, 9, self.cost, self.sequence);
useprint(other, 9, price, self.sequence);

if (other.points >= self.cost && other.button7) {
addmoney(other, -self.cost, 0);
if (other.points >= price && other.button7) {
addmoney(other, -price, 0);

// Pass along the Perk information to the Player to avoid complications later on, then Drink!
other.style = self.style;
Expand Down

0 comments on commit 63a0799

Please sign in to comment.