From 03b639276bc886f54a472b6e65feca98bc90ddca Mon Sep 17 00:00:00 2001 From: bgkillas Date: Thu, 28 Nov 2024 08:42:50 -0500 Subject: [PATCH] fix karl dying :( --- .../scripts/buildings/racing_cart_check.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 quant.ew/data/scripts/buildings/racing_cart_check.lua diff --git a/quant.ew/data/scripts/buildings/racing_cart_check.lua b/quant.ew/data/scripts/buildings/racing_cart_check.lua new file mode 100644 index 00000000..2ee8995f --- /dev/null +++ b/quant.ew/data/scripts/buildings/racing_cart_check.lua @@ -0,0 +1,19 @@ +dofile_once( "data/scripts/lib/utilities.lua" ) + +local entity_id = GetUpdatedEntityID() +local x, y = EntityGetTransform( entity_id ) + +local targets = EntityGetInRadiusWithTag( x, y, 20, "small_friend" ) +if ( #targets > 0 ) then + for i,t in ipairs( targets ) do + if ( EntityHasTag( t, "polymorphed") == false ) and not EntityHasTag(t, "racing_cart") then + EntityKill( t ) + + EntitySetComponentsWithTagEnabled( entity_id, "driver", true ) + EntitySetComponentsWithTagEnabled( entity_id, "driverless", false ) + + EntityAddTag( entity_id, "small_friend" ) + return + end + end +end