Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EasyLogic Line 2120, ONUSE Event #6

Open
guljam opened this issue Jan 15, 2018 · 1 comment
Open

EasyLogic Line 2120, ONUSE Event #6

guljam opened this issue Jan 15, 2018 · 1 comment

Comments

@guljam
Copy link

guljam commented Jan 15, 2018

::VSLib.EasyLogic.Events.OnGameEvent_player_use <- function (params)
{
local ents = ::VSLib.EasyLogic.GetPlayersFromEvent(params);
This line ---------> "local targetid = ::VSLib.EasyLogic.GetEventPlayer(params, "targetid");"

local _id = ents.entity.GetIndex();
if(_id in ::VSLib.EasyLogic.Cache)
	::VSLib.EasyLogic.Cache[_id]._lastUse <- targetid;

foreach (func in ::VSLib.EasyLogic.Notifications.OnUse)
	func(ents.entity, targetid, params);

}

Can "targetid" be a VSlib player?
I think this should use the "GetEventEntity" function.
but, OnUse event has not issued an error so far.

@neil-119
Copy link
Member

neil-119 commented Feb 3, 2018

It's been a really long time since I coded this, but IIRC it should be compatible with VSLib player objects. player_use refers to a player object, which is also an entity but not just any entity, but a player entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants