Fixed feed-delay flag

This commit is contained in:
Eric Puidokas 2011-11-29 19:40:08 -08:00
parent 5856b002df
commit 944539453e

View File

@ -167,9 +167,11 @@ private void processFeed(ApplicableRegionSet applicable, Player player,
if (feedDelay <= 0) { if (feedDelay <= 0) {
player.setFoodLevel(feedAmount > 0 ? maxHunger : minHunger); player.setFoodLevel(feedAmount > 0 ? maxHunger : minHunger);
state.lastFeed = now;
} else if (now - state.lastFeed > feedDelay * 1000) { } else if (now - state.lastFeed > feedDelay * 1000) {
// clamp health between minimum and maximum // clamp health between minimum and maximum
player.setFoodLevel(Math.min(maxHunger, Math.max(minHunger, player.getFoodLevel() + feedAmount))); player.setFoodLevel(Math.min(maxHunger, Math.max(minHunger, player.getFoodLevel() + feedAmount)));
state.lastFeed = now;
} }
} }