Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Shuttle Crash Crash For Hijack (#3674)
This PR fixes a crash... with shuttles crashing! Namely with this runtime on round 17377 that prevent the shuttle from launching: ``` [2023-06-19 11:33:51.878] runtime error: Cannot read null.related - proc name: get area turfs (/proc/get_area_turfs) - source file: code/__HELPERS/unsorted.dm,1251 - usr: Young Queen (/mob/living/carbon/xenomorph/queen) - src: null - usr.loc: the floor (35,50,2) (/turf/open/shuttle/dropship) - call stack: - get area turfs(/area/almayer/shipboard/brig/d... (/area/almayer/shipboard/brig/dress)) - /datum/dropship_hijack/almayer (/datum/dropship_hijack/almayer): target crash site("Upper deck Foreship") - the dropship navigation comput... (/obj/structure/machinery/computer/shuttle/dropship/flight): hijack(Young Queen (/mob/living/carbon/xenomorph/queen), 0) - the dropship navigation comput... (/obj/structure/machinery/computer/shuttle/dropship/flight): attack alien(Young Queen (/mob/living/carbon/xenomorph/queen)) - Young Queen (/mob/living/carbon/xenomorph/queen): UnarmedAttack(the dropship navigation comput... (/obj/structure/machinery/computer/shuttle/dropship/flight), 1, /list (/list), 0, 0) - Young Queen (/mob/living/carbon/xenomorph/queen): click adjacent(the dropship navigation comput... (/obj/structure/machinery/computer/shuttle/dropship/flight), null, /list (/list)) - Young Queen (/mob/living/carbon/xenomorph/queen): do click(the dropship navigation comput... (/obj/structure/machinery/computer/shuttle/dropship/flight), the floor (36,51,2) (/turf/open/shuttle/dropship), "icon-x=24;icon-y=6;left=1;butt...") - SOMEONE (/client): Click(the dropship navigation comput... (/obj/structure/machinery/computer/shuttle/dropship/flight), the floor (36,51,2) (/turf/open/shuttle/dropship), "mapwindow.map", "icon-x=24;icon-y=6;left=1;butt...") ``` # Explain why it's good for the game Not only does this fix the case of a non-existent /area/almayer/shipboard/brig/dress being selected, it will now evenly weight the possibilities of landing sites. Previously this code would favor smaller areas because an area that was 1 tile would be just as likely as an area with 20k tiles. # Testing Photographs and Procedure <details> <summary>Screenshots & Videos</summary> ![image](https://github.com/cmss13-devs/cmss13/assets/76988376/aa45fd06-6b8b-44b0-85b7-ff98f3038555) </details> # Changelog :cl: Drathek Firartix fix: Fixed a crash with hijack code possibly picking a non-existent brig area, and weighting smaller areas heavier. /:cl:
- Loading branch information