mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 18:39:27 -05:00
don't use keys with invalid instance names
This commit is contained in:
@@ -1943,6 +1943,11 @@ function init_socket(args)
|
|||||||
ui_log("Can't reach","gray");
|
ui_log("Can't reach","gray");
|
||||||
transporting=false;
|
transporting=false;
|
||||||
}
|
}
|
||||||
|
else if(response=="transport_cant_invalid")
|
||||||
|
{
|
||||||
|
ui_log("Instance not found","gray");
|
||||||
|
transporting=false;
|
||||||
|
}
|
||||||
else if(response=="transport_cant_item")
|
else if(response=="transport_cant_item")
|
||||||
{
|
{
|
||||||
ui_log("Item not found","gray");
|
ui_log("Item not found","gray");
|
||||||
|
|||||||
+9
-2
@@ -5048,8 +5048,15 @@ function init_io() {
|
|||||||
if (simple_distance(player, { in: f, map: f, x: ref[0], y: ref[1] }) > 120) {
|
if (simple_distance(player, { in: f, map: f, x: ref[0], y: ref[1] }) > 120) {
|
||||||
return fail_response("transport_cant_reach");
|
return fail_response("transport_cant_reach");
|
||||||
}
|
}
|
||||||
if (data.name && instances[data.name] && instances[data.name].map == data.place) {
|
if (data.name) {
|
||||||
transport_player_to(player, data.name);
|
// Player requested to enter an existing instance
|
||||||
|
if (instances[data.name] && instances[data.name].map == data.place) {
|
||||||
|
// The instance exists
|
||||||
|
transport_player_to(player, data.name);
|
||||||
|
} else {
|
||||||
|
// The instance doesn't exist
|
||||||
|
return fail_response("transport_cant_invalid");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!consume_one_by_id(player, item)) {
|
if (!consume_one_by_id(player, item)) {
|
||||||
return fail_response("transport_cant_item");
|
return fail_response("transport_cant_item");
|
||||||
|
|||||||
Reference in New Issue
Block a user