mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-09-30 15:13:10 -04:00
Combat check before starting trading session
This commit is contained in:
@@ -98,10 +98,13 @@ public class TradeService implements INetworkDispatch{
|
||||
|
||||
// creates a new trade session for the user who sent the request. It's given the objectID
|
||||
// that the player wants to trade with.
|
||||
senderClient.getSession().setAttribute("tradeSession", recieverID);
|
||||
|
||||
recieverObject.sendSystemMessage(senderObject.getCustomName() + " wants to trade with you.", (byte) 0);
|
||||
|
||||
if (senderObject.getCombatFlag() == 0 && recieverObject.getCombatFlag() == 0) {
|
||||
senderClient.getSession().setAttribute("tradeSession", recieverID);
|
||||
|
||||
recieverObject.sendSystemMessage(senderObject.getCustomName() + " wants to trade with you.", (byte) 0);
|
||||
} else {
|
||||
senderObject.sendSystemMessage("You can't send a trade request while you or your target is in combat.", (byte) 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user