Player character alts can now access harvesters and generators placed on same account

This commit is contained in:
Erusman
2021-09-10 07:03:17 -07:00
parent 62986128c1
commit 084c6d0156
2 changed files with 4 additions and 4 deletions
@@ -22290,11 +22290,11 @@ public class base_class
/**
* Check station id to see if two characters belong to the same account
*
* @param player1
* @param player1
* @param player2
* @return true or false
*/
private static boolean charactersAreSamePlayer(obj_id player1, obj_id player2) {
public static boolean charactersAreSamePlayer(obj_id player1, obj_id player2) {
return getPlayerStationId(player1) == getPlayerStationId(player2);
}
@@ -91,7 +91,7 @@ public class terminal_structure extends script.base_script
int owner_root = mi.addRootMenu(menu_info_types.SERVER_MENU16, SID_SHOW_MAYOR_OWNER);
}
}
if (player_structure.isAdmin(structure, player))
if (player_structure.isAdmin(structure, player) || charactersAreSamePlayer(player, getOwner(structure)))
{
blog("terminal_structure::OnObjectMenuRequest - you are admin");
if (player_structure.isHarvester(structure) || player_structure.isGenerator(structure))
@@ -299,7 +299,7 @@ public class terminal_structure extends script.base_script
player_structure.validateHarvestedResources(structure);
}
}
if (!player_structure.isAdmin(structure, player) && !player_structure.isAbandoned(structure))
if (!player_structure.isAdmin(structure, player) && !charactersAreSamePlayer(player, getOwner(structure)) && !player_structure.isAbandoned(structure))
{
return SCRIPT_CONTINUE;
}