mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-12 03:13:00 -04:00
Player character alts can now access harvesters and generators placed on same account
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user