mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-04 05:16:21 -04:00
Fixed a container limit bug
This commit is contained in:
@@ -4,17 +4,18 @@ def setup():
|
||||
return
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
canEquip = core.equipmentService.canEquip(actor, target)
|
||||
|
||||
if canEquip[0] is False:
|
||||
actor.sendSystemMessage(canEquip[1], 0)
|
||||
return
|
||||
|
||||
|
||||
parsedMsg = commandString.split(' ', 3)
|
||||
objService = core.objectService
|
||||
containerID = long(parsedMsg[1])
|
||||
container = objService.getObject(containerID)
|
||||
|
||||
canEquip = core.equipmentService.canEquip(actor, target)
|
||||
|
||||
if canEquip[0] is False and container == actor:
|
||||
actor.sendSystemMessage(canEquip[1], 0)
|
||||
return
|
||||
|
||||
if target and container and target.getContainer():
|
||||
oldContainer = target.getContainer()
|
||||
if container == oldContainer:
|
||||
|
||||
@@ -45,7 +45,7 @@ def run(core, actor, target, commandString):
|
||||
|
||||
canEquip = core.equipmentService.canEquip(actor, target)
|
||||
|
||||
if canEquip[0] is False:
|
||||
if canEquip[0] is False and container == actor:
|
||||
actor.sendSystemMessage(canEquip[1], 0)
|
||||
return
|
||||
|
||||
|
||||
@@ -4,11 +4,7 @@ def setup():
|
||||
return
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
canEquip = core.equipmentService.canEquip(actor, target)
|
||||
|
||||
if canEquip[0] is False:
|
||||
actor.sendSystemMessage(canEquip[1], 0)
|
||||
return
|
||||
|
||||
|
||||
|
||||
parsedMsg = commandString.split(' ', 3)
|
||||
@@ -21,6 +17,12 @@ def run(core, actor, target, commandString):
|
||||
print 'Error: New container is same as old container.'
|
||||
return;
|
||||
|
||||
canEquip = core.equipmentService.canEquip(actor, target)
|
||||
|
||||
if canEquip[0] is False and container == actor:
|
||||
actor.sendSystemMessage(canEquip[1], 0)
|
||||
return
|
||||
|
||||
replacedObject = None
|
||||
slotName = None
|
||||
replacedObjects = []
|
||||
|
||||
@@ -697,6 +697,8 @@ public class TangibleObject extends SWGObject implements Serializable {
|
||||
|
||||
int containerVolumeLimit = (int)getTemplateData().getAttribute("containerVolumeLimit") >> 8; // Shifting because it seems to be returning an extra byte before it should
|
||||
|
||||
if(containerVolumeLimit == 0) return false;
|
||||
|
||||
if(NGECore.getInstance().objectService.objsInContainer(this, this) >= containerVolumeLimit) return true;
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user