mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-07 22:13:40 -04:00
Merged in M4SS/holocore (pull request #396)
Fixed being unable to equip items outside of buildings
This commit is contained in:
@@ -31,6 +31,7 @@ package resources.commands.callbacks;
|
||||
import intents.chat.ChatBroadcastIntent;
|
||||
import resources.Race;
|
||||
import resources.commands.ICmdCallback;
|
||||
import resources.control.Assert;
|
||||
import resources.objects.GameObjectType;
|
||||
import resources.objects.SWGObject;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
@@ -88,6 +89,8 @@ public class TransferItemCallback implements ICmdCallback {
|
||||
|
||||
SWGObject appearanceInventory = actor.getSlottedObject("appearance_inventory");
|
||||
|
||||
Assert.notNull(appearanceInventory);
|
||||
|
||||
// TODO move check to CommandService. There's an in-combat boolean column in the command table!
|
||||
// You can't equip or unequip non-weapon equipment whilst in combat
|
||||
if (!weapon && actor.isInCombat() && ((newContainer.equals(actor) || oldContainer.equals(actor)) || (newContainer.equals(appearanceInventory) || oldContainer.equals(appearanceInventory)))) {
|
||||
@@ -102,7 +105,9 @@ public class TransferItemCallback implements ICmdCallback {
|
||||
}
|
||||
|
||||
// We can't transfer an item into an appearance-equipped container!
|
||||
if (newContainer.getParent().equals(appearanceInventory)) {
|
||||
SWGObject containerParent = newContainer.getParent();
|
||||
|
||||
if (containerParent != null && containerParent.equals(appearanceInventory)) {
|
||||
// Don't be fooled - the message below contains no prose keys
|
||||
new ChatBroadcastIntent(player, "@container_error_message:container34_prose").broadcast();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user