Tsuey / L4D2-Community-Update

Help us shape the potential future of L4D2 vanilla.
70 stars 23 forks source link

Some physical props not calling CanPickupObject callback fix #424

Closed Nesciuse closed 1 year ago

Nesciuse commented 1 year ago

Problem When player presses use key on a physics object that's solid, below 35kg while scriptedmode is active and there is CanPickupObject callback defined it will be called with the prop the player used as handle.

function CanPickupObject( handle_of_the_prop ) {
  return should_be_pickable //true or false
}

returning true in this callback makes the game put the prop intended to be picked up into player's hand. Returning false prevenets that. The conditions to return true or false will be whatever the scripter wants. Holdout mutation returns true when using the placable mines for example. The issue with the props in this PR is that when clicking use on them they don't call this callback to determine whether picking them up is allowed, so you can't make them pickable using just the callback if you wanted.

Solution Removing flag 512 which prevents pickup. This flag only affects CanPickupObject callback in l4d2

Amount of props that have that flag and should call the callback when used but the flag is preventing it: "c2m3_coaster" : 5 "c6m2_bedlam" : 4, //will do pull request for this one later "c6m3_port" : 1 "c7m2_barge" : 2 "c8m1_apartment" : 2 "c8m2_subway" : 9 "c8m3_sewers" : 33 "c8m4_interior" : 9 "c8m5_rooftop" : 20

video that shows all edited props https://www.youtube.com/watch?v=dBKvqnEIWLQ