Differentiated cancel message

I've tested this. as you said this wasn't a bug. and now fixed it!

Former-commit-id: 6271af2d789568871fafaee6dfbac70fb5ab0805 [formerly 9201e18e60d85a04e4ad29e2aa59c008f01d1cf3]
Former-commit-id: 89729f12106658be1306d1a24a0dc85a43550388
This commit is contained in:
jho5245 authored and GitHub committed 2019-11-16 22:39:48 +09:00
1 parent db6ce34f1a
commit d8ed01a7e4
1 file changed
+10 -8
@@ -838,19 +838,21 @@ public class ShopManager {
if (info == null) {
return; // multithreaded means this can happen
}
if (info.getLocation().getWorld() != p.getLocation().getWorld()) {
p.sendMessage(MsgUtil.getMessage("shop-creation-cancelled", p));
return;
}
if (info.getLocation().distanceSquared(p.getLocation()) > 25) {
p.sendMessage(MsgUtil.getMessage("shop-creation-cancelled", p));
return;
}
boolean cancelAction = info.getLocation().distanceSquared(p.getLocation()) > 25 || info.getLocation().getWorld() != p.getLocation().getWorld();
switch (info.getAction()) {
case CREATE:
if (cancelAction) {
p.sendMessage(MsgUtil.getMessage("shop-creation-cancelled", p));
return;
}
actionCreate(p, actions, info, message, bypassProtectionChecks);
break;
case BUY:
if (cancelAction) {
p.sendMessage(MsgUtil.getMessage("shop-purchase-cancelled", p));
return;
}
actionTrade(p, actions, info, message);
break;
case CANCELLED: