Rail transport doesn't killSolved

Hello again :) I noticed that the plugin works on all rail vehicles, not only those purchased by players, I would also like to see this in the config, because at the moment I have to cut the condition from *.cs after the each update, I would be very grateful :)

493-507 string remove.

before:

        private object OnEntityEnter(TriggerHurtNotChild triggerHurtNotChild, BasePlayer player)
        {
            if (triggerHurtNotChild == null || player == null || triggerHurtNotChild.SourceEntity == null)
            {
                return null;
            }
            var sourceEntity = triggerHurtNotChild.SourceEntity;
            if (vehiclesCache.ContainsKey(sourceEntity))
            {
                var baseVehicle = sourceEntity as BaseVehicle;
                if (baseVehicle != null && player.userID.IsSteamId())
                {
                    if (baseVehicle is TrainEngine)
                    {
                        var transform = triggerHurtNotChild.transform;
                        MoveToPosition(player, transform.position + (Random.value >= 0.5f ? -transform.right : transform.right) * 2.5f);
                        return _false;
                    }
                    Vector3 pos;
                    if (GetDismountPosition(baseVehicle, player, out pos))
                    {
                        MoveToPosition(player, pos);
                    }
                }
                //triggerHurtNotChild.enabled = false;
                return _false;
            }
            return null;
        }

after:

        private object OnEntityEnter(TriggerHurtNotChild triggerHurtNotChild, BasePlayer player)
        {
            if (triggerHurtNotChild == null || player == null || triggerHurtNotChild.SourceEntity == null)
            {
                return null;
            }
            var sourceEntity = triggerHurtNotChild.SourceEntity;
            if (vehiclesCache.ContainsKey(sourceEntity))
            {
                var baseVehicle = sourceEntity as BaseVehicle;

                return _false;
            }
            return null;
        }

That doesn't entirely make sense imo. The code on the inside only happens if the vehicle exists in the vehicle cache, which means that vehicle was spawned via VehicleLicence, whether it was purchased through a vendor or not. I don't understand why it would affect your non-purchased vehicles. Any way you could give more info on the issue? Because logically speaking code wise, it will completely ignore any rail car not spawned via the plugin as then it wouldn't be in the ``vehicleCache``.

After also testing this in game, thats just not true. I just tried using a workcart that was not spawned via the plugin and I don't get dismounted into a new dismount position/a proper dismount positon, it just lets me jump off, where as when I did it with my spawned one it put me into a proper dismount position regardless of where I jumped from.

 

I have a feeling theres an external plugin affecting it, or something else is happening as it works exactly as its said to with my tests, I also have no reports of anything like this from anyone else, though that could change, but as of now, theres none other than yours.

the fact that this affects other vehicles is not the main problem, I apologize, I could have been mistaken in that the vehicle was not from the VehicleLicence. I'll check this too

The main question is that I can regulate whether or not the player is killed from my vehicles, because... this can sometimes push the player beyond the textures, moreover, sometimes it comes to death, and the player does not have the opportunity to pick up his loot, I have to intervene :) thanks)

Are you by-chance using a custom map with custom built train tracks?

no, i use procedural, this issue was in tunnel station

Hmm, okay, guess I'll have to further test, does this happen often? I tried it quite a few times and it seemed fine every time I had tried. Though I could probably add a config setting to disable the safe dismounting.

Will look into doing at some point once I finish testing proper recalling without requiring to kill the vehicle to make it get to the location quicker.

I wouldn’t want to spark any conflicts and misunderstandings, but I think you can take a solution in SpawnMini :)

SpooksAU, if u read it, sorry, and thanks for u job too <3

aimacak

I wouldn’t want to spark any conflicts and misunderstandings, but I think you can take a solution in SpawnMini :)

SpooksAU, if u read it, sorry, and thanks for u job too <3

I've already figured out a good way to do it, just making sure it works for all vehicles in the plugin and causes no issues. The version I was going to post wouldn't have fully worked with trains, so I am just trying to make 100% certain the vehicle modifications I am doing during the recall are properly affecting the vehicles I am recalling. And in regards to taking a look at SpawnMini as a reference, I am sorta referencing SpawnModularCar as WhiteThunder suggested against my recallkilling method lol Also after taking a look just now, it seems the exact same basically, just slightly different.

then we are waiting :) thanks for your work, and I am very glad that this plugin was not abandoned

The newest version that will be updated to will have a config setting for this now. It's called "Safe dismount players who jump off train" and if disabled will no longer attempt to dismount them in a "safe" fashion.

thanks a lot <3

Locked automatically