Fixed a container limit bug

This commit is contained in:
Seefo
2014-05-11 12:42:40 -04:00
parent bc25be3bed
commit c47ddf77df
4 changed files with 17 additions and 12 deletions
+7 -6
View File
@@ -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:
+1 -1
View File
@@ -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
+7 -5
View File
@@ -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;