Skip to content

Commit

Permalink
Merge branch 'dev' into ALTV-626
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Jan 9, 2025
2 parents 30c5ee2 + 22a3e36 commit 6fe5dc1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
13 changes: 0 additions & 13 deletions server/src/events/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "cpp-sdk/events/CPlayerWeaponChangeEvent.h"
#include "cpp-sdk/events/CLocalMetaDataChangeEvent.h"
#include "cpp-sdk/events/CPlayerRequestControlEvent.h"
#include "cpp-sdk/events/CPlayerChangeInteriorEvent.h"

using alt::CEvent;
using EventType = CEvent::Type;
Expand Down Expand Up @@ -185,18 +184,6 @@ V8_LOCAL_EVENT_HANDLER requestControl(EventType::PLAYER_REQUEST_CONTROL,
args.push_back(resource->GetBaseObjectOrNull(ev->GetTarget()));
});

V8_LOCAL_EVENT_HANDLER playerInteriorChange(EventType::PLAYER_CHANGE_INTERIOR_EVENT,
"playerInteriorChange",
[](V8ResourceImpl* resource, const alt::CEvent* e, std::vector<v8::Local<v8::Value>>& args)
{
auto ev = static_cast<const alt::CPlayerChangeInteriorEvent*>(e);
v8::Isolate* isolate = resource->GetIsolate();

args.push_back(resource->GetBaseObjectOrNull(ev->GetTarget()));
args.push_back(V8Helpers::JSValue(ev->GetOldInteriorLocation()));
args.push_back(V8Helpers::JSValue(ev->GetNewInteriorLocation()));
});

V8_LOCAL_EVENT_HANDLER playerSpawn(EventType::PLAYER_SPAWN,
"playerSpawn",
[](V8ResourceImpl* resource, const alt::CEvent* e, std::vector<v8::Local<v8::Value>>& args)
Expand Down
23 changes: 18 additions & 5 deletions shared/events/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "../V8Helpers.h"

#include "cpp-sdk/events/CPlayerChangeAnimationEvent.h"
#include "cpp-sdk/events/CPlayerChangeInteriorEvent.h"
#include "cpp-sdk/events/CPlayerDimensionChangeEvent.h"

using EventType = alt::CEvent::Type;
Expand All @@ -13,11 +14,23 @@ V8_LOCAL_EVENT_HANDLER animationChange(EventType::PLAYER_CHANGE_ANIMATION_EVENT,
auto ev = static_cast<const alt::CPlayerChangeAnimationEvent*>(e);
v8::Isolate* isolate = resource->GetIsolate();

args.push_back(resource->GetBaseObjectOrNull(ev->GetTarget()));
args.push_back(V8Helpers::JSValue(ev->GetOldAnimationDict()));
args.push_back(V8Helpers::JSValue(ev->GetNewAnimationDict()));
args.push_back(V8Helpers::JSValue(ev->GetOldAnimationName()));
args.push_back(V8Helpers::JSValue(ev->GetNewAnimationName()));
args.emplace_back(resource->GetBaseObjectOrNull(ev->GetTarget()));
args.emplace_back(V8Helpers::JSValue(ev->GetOldAnimationDict()));
args.emplace_back(V8Helpers::JSValue(ev->GetNewAnimationDict()));
args.emplace_back(V8Helpers::JSValue(ev->GetOldAnimationName()));
args.emplace_back(V8Helpers::JSValue(ev->GetNewAnimationName()));
});

V8_LOCAL_EVENT_HANDLER playerInteriorChange(EventType::PLAYER_CHANGE_INTERIOR_EVENT,
"playerInteriorChange",
[](V8ResourceImpl* resource, const alt::CEvent* e, std::vector<v8::Local<v8::Value>>& args)
{
auto ev = static_cast<const alt::CPlayerChangeInteriorEvent*>(e);
v8::Isolate* isolate = resource->GetIsolate();

args.emplace_back(resource->GetBaseObjectOrNull(ev->GetTarget()));
args.emplace_back(V8Helpers::JSValue(ev->GetOldInteriorLocation()));
args.emplace_back(V8Helpers::JSValue(ev->GetNewInteriorLocation()));
});

V8_LOCAL_EVENT_HANDLER playerDimensionChange(EventType::PLAYER_DIMENSION_CHANGE,
Expand Down

0 comments on commit 6fe5dc1

Please sign in to comment.