mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-18 03:21:47 +02:00
Setting shooting state seems not to work.
Locks the player into shooting. Moved the logic above the permission setting
This commit is contained in:
parent
662398069d
commit
8e770f6052
@ -181,17 +181,19 @@ function Module.jail(target_player, player)
|
||||
|
||||
-- Kick player out of vehicle
|
||||
target_player.driving=false
|
||||
-- Add player to jail group
|
||||
permission_group.add_player(target_player)
|
||||
|
||||
-- If a player is shooting when they're jailed they can't stop shooting, so we change their shooting state
|
||||
if target_player.shooting_state.state ~= 0 then
|
||||
target_player.shooting_state.state = {state = defines.shooting.not_shooting, position = {0,0}}
|
||||
end
|
||||
|
||||
if jail_target.walking_state.walking == true -- Stop them walking while jailed
|
||||
jail_target.walking_state = {walking = false, direction = defines.direction.north}
|
||||
if jail_target.walking_state.walking == true then -- Stop them walking while jailed
|
||||
jail_target.walking_state = {walking = false, direction = defines.direction.north}
|
||||
end
|
||||
|
||||
-- Add player to jail group
|
||||
permission_group.add_player(target_player)
|
||||
|
||||
-- Check that it worked
|
||||
if target_player.permission_group == permission_group then
|
||||
-- Let admin know it worked, let target know what's going on.
|
||||
|
Loading…
x
Reference in New Issue
Block a user