From 9b4d3d2f4d9213d31acf8af8b73c31caa405dfd5 Mon Sep 17 00:00:00 2001 From: Darin McBride Date: Sat, 28 Nov 2015 22:15:02 -0700 Subject: [PATCH] Changing to allied stations was changing current empire. Station access is done as yourself, so force it. --- lib/Lacuna/RPC.pm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/RPC.pm b/lib/Lacuna/RPC.pm index d3760bcb..5040e36e 100644 --- a/lib/Lacuna/RPC.pm +++ b/lib/Lacuna/RPC.pm @@ -36,14 +36,30 @@ sub get_session { %$opts); $session->current_building($building); $session->current_body($building->body); - $session->current_empire($session->current_body->empire); + if ($session->current_body->isa('Lacuna::DB::Result::Map::Body::Planet::Station')) + { + # all station access is as yourself. + $session->current_empire($session->empire); + } + else + { + $session->current_empire($session->current_body->empire); + } } elsif ($opts->{body_id}) { my $body = $self->get_body($session->empire, $opts->{body_id}); $session->clear_building; $session->current_body($body); - $session->current_empire($session->current_body->empire); + if ($session->current_body->isa('Lacuna::DB::Result::Map::Body::Planet::Station')) + { + # all station access is as yourself. + $session->current_empire($session->empire); + } + else + { + $session->current_empire($session->current_body->empire); + } } $session->current_empire($session->empire) -- 2.54.0