mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 12:26:44 +00:00 
			
		
		
		
	Take in account elemental shields for GetResist and SetResist script commands (bug #4093)
This commit is contained in:
		
							parent
							
								
									335ecd1162
								
							
						
					
					
						commit
						c6fd75bf42
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		|  | @ -1189,6 +1189,14 @@ namespace MWScript | |||
|                 if (mNegativeEffect != -1) | ||||
|                     currentValue -= effects.get(mNegativeEffect).getMagnitude(); | ||||
| 
 | ||||
|                 // GetResist* should take in account elemental shields
 | ||||
|                 if (mPositiveEffect == ESM::MagicEffect::ResistFire) | ||||
|                     currentValue += effects.get(ESM::MagicEffect::FireShield).getMagnitude(); | ||||
|                 if (mPositiveEffect == ESM::MagicEffect::ResistShock) | ||||
|                     currentValue += effects.get(ESM::MagicEffect::LightningShield).getMagnitude(); | ||||
|                 if (mPositiveEffect == ESM::MagicEffect::ResistFrost) | ||||
|                     currentValue += effects.get(ESM::MagicEffect::FrostShield).getMagnitude(); | ||||
| 
 | ||||
|                 int ret = static_cast<int>(currentValue); | ||||
|                 runtime.push(ret); | ||||
|             } | ||||
|  | @ -1215,6 +1223,14 @@ namespace MWScript | |||
|                 if (mNegativeEffect != -1) | ||||
|                     currentValue -= effects.get(mNegativeEffect).getMagnitude(); | ||||
| 
 | ||||
|                 // SetResist* should take in account elemental shields
 | ||||
|                 if (mPositiveEffect == ESM::MagicEffect::ResistFire) | ||||
|                     currentValue += effects.get(ESM::MagicEffect::FireShield).getMagnitude(); | ||||
|                 if (mPositiveEffect == ESM::MagicEffect::ResistShock) | ||||
|                     currentValue += effects.get(ESM::MagicEffect::LightningShield).getMagnitude(); | ||||
|                 if (mPositiveEffect == ESM::MagicEffect::ResistFrost) | ||||
|                     currentValue += effects.get(ESM::MagicEffect::FrostShield).getMagnitude(); | ||||
| 
 | ||||
|                 int arg = runtime[0].mInteger; | ||||
|                 runtime.pop(); | ||||
|                 effects.modifyBase(mPositiveEffect, (arg - static_cast<int>(currentValue))); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue