mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Improve AI prioritising health potions
This commit is contained in:
parent
a29abb85f1
commit
8a210c49e9
@ -294,7 +294,10 @@ namespace MWMechanics
|
||||
// Effect doesn't heal more than we need, *or* we are below 1/2 health
|
||||
if (current.getModified() - current.getCurrent() > toHeal
|
||||
|| current.getCurrent() < current.getModified()*0.5)
|
||||
return 10000.f * priority;
|
||||
{
|
||||
return 10000.f * priority
|
||||
- (toHeal - (current.getModified()-current.getCurrent())); // prefer the most fitting potion
|
||||
}
|
||||
else
|
||||
return -10000.f * priority; // Save for later
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user