mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Fixed other errors
This commit is contained in:
@@ -157,7 +157,7 @@ Event.add(defines.events.on_pre_player_mined_item, function(event)
|
||||
local player = game.get_player(event.player_index)
|
||||
-- Check if the player should be ignored
|
||||
if config.ignore_admins and player.admin then return end
|
||||
if entity.last_user.index == player.index then return end
|
||||
if entity.last_user == nil or entity.last_user.index == player.index then return end
|
||||
if config.ignore_permission and Roles.player_allowed(player, config.ignore_permission) then return end
|
||||
|
||||
-- Check if the entity is protected
|
||||
|
||||
@@ -35,9 +35,11 @@ function Public.start_spectate(player)
|
||||
assert(player and player.valid, 'Invalid player given to follower')
|
||||
if spectating[player.index] or not player.character then return false end
|
||||
local character = player.character
|
||||
local opened = player.opened
|
||||
player.set_controller{ type = defines.controllers.spectator }
|
||||
player.associate_character(character)
|
||||
spectating[player.index] = character
|
||||
if opened then player.opened = opened end -- Maintain opened after controller change
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user