Skip to content

Commit

Permalink
add colshape event
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonMrBonnie committed Mar 18, 2023
1 parent 7e74975 commit 4779ae4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions shared/js/events/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const { Event } = requireBinding("shared/events.js");

Event.register(alt.Enums.EventType.SERVER_SCRIPT_EVENT, "ServerScriptEvent");
Event.register(alt.Enums.EventType.CLIENT_SCRIPT_EVENT, "ClientScriptEvent");
// TODO: change to a better name
Event.register(alt.Enums.EventType.COLSHAPE_EVENT, "Colshape");
Event.register(alt.Enums.EventType.COLSHAPE_EVENT, "ColShapeEvent");
Event.register(alt.Enums.EventType.EXPLOSION_EVENT, "Explosion");
Event.register(alt.Enums.EventType.FIRE_EVENT, "FireStart");
Event.register(alt.Enums.EventType.START_PROJECTILE_EVENT, "ProjectileStart");
8 changes: 5 additions & 3 deletions shared/src/events/ScriptEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ static js::Event serverScriptEvent(alt::CEvent::Type::SERVER_SCRIPT_EVENT, [](co
args.Set("args", argsArray.Get());
});

// TODO
//? ColShape, CollisionShape ? Rename this
static js::Event colshapeEvent(alt::CEvent::Type::COLSHAPE_EVENT, [](const alt::CEvent* ev, js::Event::EventArgs& args)
{
//
auto e = static_cast<const alt::CColShapeEvent*>(ev);

args.Set("entity", e->GetEntity());
args.Set("colShape", e->GetTarget());
args.Set("state", e->GetState());
});

static js::Event weaponDamageEvent(alt::CEvent::Type::WEAPON_DAMAGE_EVENT, [](const alt::CEvent* ev, js::Event::EventArgs& args)
Expand Down

0 comments on commit 4779ae4

Please # to comment.