Skip to content

Commit

Permalink
Adds even more validation to tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSuckerberg committed Sep 23, 2023
1 parent ba31d89 commit 2b712b6
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions code/modules/overmap/docking_ticket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,33 @@
var/docking_error

/datum/docking_ticket/New(_target_port, _issuer, _target, _docking_error)
docking_error = _docking_error
if(docking_error)
return

if(!target_port)
docking_error = "No target port specified!"
return
target_port = _target_port
if(target_port?.current_docking_ticket)
if(target_port.current_docking_ticket)
docking_error = "[target_port] is already being docked to!"
return
if(target_port)
target_port.current_docking_ticket = src
target_port.current_docking_ticket = src

if(!issuer)
docking_error = "No issuer overmap datum specified!"
return
issuer = _issuer

if(!target)
docking_error = "No target overmap datum specified!"
return
target = _target
if(target.current_docking_ticket)
docking_error = "[target] is already docking!"
return
target.current_docking_ticket = src

docking_error = _docking_error

/datum/docking_ticket/Destroy(force, ...)
if(target)
Expand Down

0 comments on commit 2b712b6

Please sign in to comment.