Carts: Re-add erroneously removed driver reset
authorSmallJoker <mk939@ymail.com>
Sat, 16 May 2020 17:26:28 +0000 (19:26 +0200)
committerSmallJoker <mk939@ymail.com>
Sat, 16 May 2020 17:26:28 +0000 (19:26 +0200)
carts:manage_attachment does not handle the driver value of the cart,
hence carts could not be used by another player until it's replaced.

mods/carts/cart_entity.lua

index b95fde703eba92cc9f141efb040ec16e8eacb95c..734711be9714bed849d60612f5784bc379ce4e7b 100644 (file)
@@ -66,6 +66,7 @@ end
 -- 0.5.x and later: When the driver leaves
 function cart_entity:on_detach_child(child)
        if child and child:get_player_name() == self.driver then
+               self.driver = nil
                carts:manage_attachment(child, nil)
        end
 end