Refactors pie throwing and fixes throwing not finalizing in some cases

This commit is contained in:
CitadelStationBot
2017-08-01 07:48:16 -05:00
parent bbcad2fa58
commit d176fcf24c
2 changed files with 29 additions and 23 deletions
+7 -6
View File
@@ -103,7 +103,7 @@ SUBSYSTEM_DEF(throwing)
finalize()
return
/datum/thrownthing/proc/finalize(hit = FALSE)
/datum/thrownthing/proc/finalize(hit = FALSE, target=null)
set waitfor = 0
SSthrowing.processing -= thrownthing
//done throwing, either because it hit something or it finished moving
@@ -120,13 +120,15 @@ SUBSYSTEM_DEF(throwing)
thrownthing.newtonian_move(init_dir)
else
thrownthing.newtonian_move(init_dir)
if(target)
thrownthing.throw_impact(target, src)
if (callback)
callback.Invoke()
/datum/thrownthing/proc/hit_atom(atom/A)
thrownthing.throw_impact(A, src)
thrownthing.newtonian_move(init_dir)
finalize(TRUE)
finalize(hit=TRUE, target=A)
/datum/thrownthing/proc/hitcheck()
for (var/thing in get_turf(thrownthing))
@@ -134,6 +136,5 @@ SUBSYSTEM_DEF(throwing)
if (AM == thrownthing)
continue
if (AM.density && !(AM.pass_flags & LETPASSTHROW) && !(AM.flags & ON_BORDER))
thrownthing.throwing = null
thrownthing.throw_impact(AM, src)
finalize(hit=TRUE, target=AM)
return TRUE