mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 18:39:28 -05:00
Merge pull request #91 from earthiverse/instances
Improve instance enter handling
This commit is contained in:
@@ -1943,6 +1943,11 @@ function init_socket(args)
|
||||
ui_log("Can't reach","gray");
|
||||
transporting=false;
|
||||
}
|
||||
else if(response=="transport_cant_invalid")
|
||||
{
|
||||
ui_log("Instance not found","gray");
|
||||
transporting=false;
|
||||
}
|
||||
else if(response=="transport_cant_item")
|
||||
{
|
||||
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) {
|
||||
return fail_response("transport_cant_reach");
|
||||
}
|
||||
if (data.name && instances[data.name] && instances[data.name].map == data.place) {
|
||||
transport_player_to(player, data.name);
|
||||
if (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 {
|
||||
if (!consume_one_by_id(player, item)) {
|
||||
return fail_response("transport_cant_item");
|
||||
|
||||
Reference in New Issue
Block a user