From b3753047ad1655de94f0fdffc0987a4c05761baa Mon Sep 17 00:00:00 2001
From: Marco Hladik <marco@icculus.org>
Date: Sat, 5 Jan 2019 09:10:14 +0100
Subject: [PATCH] hostage_entity: Memorize who your last rescuer was and
 attribute $$$ to him, in case he's too far away and no longer the user.

---
 Source/Server/func_hostage_rescue.cpp | 2 +-
 Source/Server/hostage_entity.cpp      | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Source/Server/func_hostage_rescue.cpp b/Source/Server/func_hostage_rescue.cpp
index 0d01f575..032e60c5 100644
--- a/Source/Server/func_hostage_rescue.cpp
+++ b/Source/Server/func_hostage_rescue.cpp
@@ -27,7 +27,7 @@ void func_hostage_rescue::touch(void)
 		Radio_BroadcastMessage(RADIO_RESCUED);
 		iHostagesRescued++;
 
-		Money_AddMoney(hosty.m_eUser, 1000);
+		Money_AddMoney(hosty.m_eRescuer, 1000);
 		Money_QueTeamReward(TEAM_CT, 800);
 
 		CBaseEntity targa = (CBaseEntity)other;
diff --git a/Source/Server/hostage_entity.cpp b/Source/Server/hostage_entity.cpp
index f134cfa9..dafc1691 100644
--- a/Source/Server/hostage_entity.cpp
+++ b/Source/Server/hostage_entity.cpp
@@ -61,6 +61,7 @@ enum {
 class hostage_entity:CBaseEntity
 {
 	entity m_eUser;
+	entity m_eRescuer;
 	int m_iUsed;
 	int m_iScared;
 	void() hostage_entity;
@@ -136,6 +137,7 @@ void hostage_entity::PlayerUse(void)
 			}
 
 			m_eUser = eActivator;
+			m_eRescuer = m_eUser;
 		} else {
 			m_eUser = world;
 		}