6f0ba8e896
Co-authored-by: 3kynox <thierry.prost@gmail.com> Co-authored-by: nox <nox@noxen.net> Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
32 lines
1.3 KiB
C
32 lines
1.3 KiB
C
#include "player-interactions-api.h"
|
|
|
|
static CanPlayerInteractWithNPCAndFlagsHandler canPlayerInteractWithNPCAndFlagsHandler;
|
|
void SetCanPlayerInteractWithNPCAndFlagsHandler(CanPlayerInteractWithNPCAndFlagsHandler h) {
|
|
canPlayerInteractWithNPCAndFlagsHandler = h;
|
|
}
|
|
|
|
CanPlayerInteractWithNPCAndFlagsResponse CallCanPlayerInteractWithNPCAndFlagsHandler(uint64_t player_guid, uint64_t npc_guid, uint32_t npc_flags) {
|
|
if (canPlayerInteractWithNPCAndFlagsHandler == 0) {
|
|
CanPlayerInteractWithNPCAndFlagsResponse resp;
|
|
resp.errorCode = PlayerInteractionErrorCodeNoHandler;
|
|
return resp;
|
|
}
|
|
|
|
return canPlayerInteractWithNPCAndFlagsHandler(player_guid, npc_guid, npc_flags);
|
|
}
|
|
|
|
static CanPlayerInteractWithGOAndTypeHandler canPlayerInteractWithGOAndTypeHandler;
|
|
void SetCanPlayerInteractWithGOAndTypeHandler(CanPlayerInteractWithGOAndTypeHandler h) {
|
|
canPlayerInteractWithGOAndTypeHandler = h;
|
|
}
|
|
|
|
CanPlayerInteractWithGOAndTypeResponse CallCanPlayerInteractWithGOAndTypeHandler(uint64_t player_guid, uint64_t go_guid, uint8_t go_type) {
|
|
if (canPlayerInteractWithGOAndTypeHandler == 0) {
|
|
CanPlayerInteractWithGOAndTypeResponse resp;
|
|
resp.errorCode = PlayerInteractionErrorCodeNoHandler;
|
|
return resp;
|
|
}
|
|
|
|
return canPlayerInteractWithGOAndTypeHandler(player_guid, go_guid, go_type);
|
|
}
|