roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
https://docs.cssharp.dev
Other
743 stars 111 forks source link

Add entities pre and post think #379

Closed Yarukon closed 4 months ago

Yarukon commented 5 months ago

This will called every frame before/after entities think (maybe it will give some benefit to some features?)

Example:

RegisterListener<Listeners.OnServerPreEntityThink>(() =>
{
    // do something
});

RegisterListener<Listeners.OnServerPostEntityThink>(() =>
{
    // do something
});
roflmuffin commented 5 months ago

I'm not against this addition, but curious what problems people would use using this over regular tick and pre world update callbacks?

Yarukon commented 5 months ago

I'm not against this addition, but curious what problems people would use using this over regular tick and pre world update callbacks?

maybe update player state before/after entity think?

roflmuffin commented 5 months ago

I think I would prefer to implement this as a per-entity listener instead, and subscribed to similarly to entity io output, as I think that would probably be more useful