forked from MagicBane/Server
Begin constructor refactor
This commit is contained in:
@@ -12,7 +12,10 @@ package engine.objects;
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.gameManager.*;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -931,7 +934,7 @@ public class CharacterItemManager {
|
||||
|
||||
public synchronized boolean consume(Item i) {
|
||||
i.decrementChargesRemaining();
|
||||
if (i.getChargesRemaining() > 0)
|
||||
if ((byte) i.chargesRemaining > 0)
|
||||
return true;
|
||||
return junk(i, true);
|
||||
}
|
||||
@@ -2089,7 +2092,7 @@ public class CharacterItemManager {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasRoomInventory(short weight) {
|
||||
public boolean hasRoomInventory(int weight) {
|
||||
if (this.absCharacter == null)
|
||||
return false;
|
||||
if (this.absCharacter.getObjectType() == GameObjectType.PlayerCharacter) {
|
||||
@@ -2447,7 +2450,7 @@ public class CharacterItemManager {
|
||||
if (!item.isCanDestroy())
|
||||
return;
|
||||
|
||||
int dur = (int) item.getDurabilityCurrent();
|
||||
int dur = (int) (short) item.durabilityCurrent;
|
||||
if (dur - amount <= 0) {
|
||||
//destroy the item
|
||||
junk(item);
|
||||
|
||||
Reference in New Issue
Block a user