Home » MODDING HQ 1.13 » v1.13 Coding Talk » New Stealth Mechanics
Re: New Stealth Mechanics[message #340006 is a reply to message #340002] Tue, 10 March 2015 21:43 Go to previous messageGo to previous message
Deleted.

 
Messages:2657
Registered:December 2012
Location: Russian Federation
BTW there is funny bug in stealth cover mechanics

INT8 GetSightAdjustmentStealthAtLightLevel( SOLDIERTYPE* pSoldier, const UINT8& ubLightLevel )
{
	if (gGameExternalOptions.ubStealthEffectiveness == 0) {
		return 0;
	}

	// set scaler to scale with light level (dark = 100%)
	UINT8 ubScaler = GetBrightness( ubLightLevel );

	// last term corresponds to the maximum of ubScaler before
	ubScaler *= gGameExternalOptions.ubStealthEffectiveness / 100;

	INT8 ibStealthInPercent = GetStealth( pSoldier );

	return MINMAX100N( - ibStealthInPercent * ubScaler / 100);
}


Wrong integer calculation ubScaler *= gGameExternalOptions.ubStealthEffectiveness / 100; results in no stealth bonus at all when COVER_SYSTEM_STEALTH_EFFECTIVENESS is not 100
;-)



Left this community.

Report message to a moderator

Lieutenant

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Strategic Map load in source code
Next Topic: (New) Common Attachment Framework (new title; was The NAS Receiver)
Goto Forum:
  


Current Time: Fri Jan 10 04:41:14 GMT+2 2025

Total time taken to generate the page: 0.01141 seconds