smilz0 / Left4Bots

Improvements for the L4D2 survivor bots
https://steamcommunity.com/sharedfiles/filedetails/?id=3022416274
34 stars 4 forks source link

"fall_velocity_warp" not work since last release #90

Closed 4512369781 closed 4 months ago

4512369781 commented 4 months ago

Because "Left4Bots.GetOtherAliveSurvivors" is now a generator, so its not return a Array.

if (L4B.Settings.fall_velocity_warp != 0 && self.GetVelocity().z <= (-L4B.Settings.fall_velocity_warp))
{
    local others = [];
    foreach (surv in L4B.GetOtherAliveSurvivors(UserId))
        others.append(surv);
    if (others.len() > 0)
    {
        local to = others[RandomInt(0, others.len() - 1)];
        if (to && to.IsValid())
        {
            self.SetVelocity(Vector(0,0,0));
            //lxc fix "warp" pos
            self.SetOrigin(to.IsHangingFromLedge() ? NetProps.GetPropVector(to, "m_hangStandPos") : to.GetOrigin());

            L4B.Logger.Info(self.GetPlayerName() + " has been teleported to " + to.GetPlayerName() + " while falling");

            return L4B.Settings.bot_think_interval;
        }
    }
}
smilz0 commented 4 months ago

Hey mate, sorry for the delay. I totally overlooked this part. Thanks!

LeGurdah commented 4 months ago

Oh shit, I actually overlooked changing that part awhile ago.

I'm glad this got fixed now.

smilz0 commented 4 months ago

Oh shit, I actually overlooked changing that part awhile ago.

I'm glad this got fixed now.

Don't worry mate. This addon now got 200 settings, as i said it is impossible for a single person to test everything.