Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [SSGM Mod] Blocking Combat Refils Bug Fix
[SSGM Mod] Blocking Combat Refils Bug Fix [message #396867] Sun, 02 August 2009 16:52
Nightma12 is currently offline  Nightma12
Messages: 2593
Registered: August 2003
Karma: 0
General (2 Stars)
Category Moderator
Heya,

Theres a bug in the Combat Refils section of SSGM (This also seems to effect Reborns CombatRefil plugin too) whereby when you refil, it takes a few seconds for your health to go back to its previous position. If you get damaged during this "1 second window" then the refil stays. So if your against someone with a tib auto rifle or something and you still have the tiberium poisoning on you, you have sucessfully refil.

Ive also included a freshly compiled SSGM with this change for those interested in this fix Smile


Change:

//This script is attached to all players if combat refills are disabled.
void MDB_SSGM_Block_Refill::Created(GameObject *obj) {
	currhealth = Commands->Get_Health(obj);
	currshield = Commands->Get_Shield_Strength(obj);
	Commands->Start_Timer(obj,this,0.5f,1);
	LastDamage = The_Game()->GameDuration_Seconds;
}

void MDB_SSGM_Block_Refill::Damaged(GameObject *obj, GameObject *damager, float damage) {
	currhealth = Commands->Get_Health(obj);
	currshield = Commands->Get_Shield_Strength(obj);
	if (damage > 0.0) LastDamage = The_Game()->GameDuration_Seconds;
}

void MDB_SSGM_Block_Refill::Timer_Expired(GameObject *obj, int number) {
	if (Commands->Get_Health(obj) > currhealth || Commands->Get_Shield_Strength(obj) > currshield) {
		if (Get_Int_Parameter("All") == 1) {
			Commands->Set_Health(obj,currhealth);
			Commands->Set_Shield_Strength(obj,currshield);
		}
		else if (Get_Int_Parameter("All") == 0 && (The_Game()->GameDuration_Seconds - LastDamage) <= Settings->RefillTime) {
			Commands->Set_Health(obj,currhealth);
			Commands->Set_Shield_Strength(obj,currshield);
		}
	}
	Commands->Start_Timer(obj,this,0.5f,1);
}


To:

//This script is attached to all players if combat refills are disabled.
void MDB_SSGM_Block_Refill::Created(GameObject *obj) {
	currhealth = Commands->Get_Health(obj);
	currshield = Commands->Get_Shield_Strength(obj);
	Commands->Start_Timer(obj,this,0.01f,1);
	LastDamage = The_Game()->GameDuration_Seconds;
}

void MDB_SSGM_Block_Refill::Damaged(GameObject *obj, GameObject *damager, float damage) {
	currhealth = Commands->Get_Health(obj);
	currshield = Commands->Get_Shield_Strength(obj);
	if (damage > 0.0) LastDamage = The_Game()->GameDuration_Seconds;
}

void MDB_SSGM_Block_Refill::Timer_Expired(GameObject *obj, int number) {
	if (Commands->Get_Health(obj) > currhealth || Commands->Get_Shield_Strength(obj) > currshield) {
		if (Get_Int_Parameter("All") == 1) {
			Commands->Set_Health(obj,currhealth);
			Commands->Set_Shield_Strength(obj,currshield);
		}
		else if (Get_Int_Parameter("All") == 0 && (The_Game()->GameDuration_Seconds - LastDamage) <= Settings->RefillTime) {
			Commands->Set_Health(obj,currhealth);
			Commands->Set_Shield_Strength(obj,currshield);
		}
	}
	Commands->Start_Timer(obj,this,0.01f,1);
}




I know this is a very very small change but hopefully it should help some people out Very Happy
  • Attachment: scripts.dll
    (Size: 1.65MB, Downloaded 166 times)

[Updated on: Sun, 02 August 2009 16:53]

Report message to a moderator

Previous Topic: [Model Replacement] Flintlock Sniper Rifle
Next Topic: [skin] red black sky
Goto Forum:
  


Current Time: Tue Apr 16 08:17:56 MST 2024

Total time taken to generate the page: 0.00572 seconds