1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 17:53:53 +00:00

Improve AI prioritising health potions

This commit is contained in:
scrawl 2014-12-18 17:12:41 +01:00
parent a29abb85f1
commit 8a210c49e9

View file

@ -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
}