Files
mod-ale/VehicleHooks.cpp
Tommy 9d9e72e598 Updated method documentation and cleaned up
Method documentation should be completed. Only thing left now is polishing up (fixing typos, update wording, add enumerator data to method documentation that doesn't have it, etc)..

Cleaned whitespaces

Corrected/Fixed up some comments

Removed all known documented method comments in LuaFunctions.cpp. Commented out methods are now marked as undocumented until they are uncommented & documented in their respective header files.

Removed 'Getter, Setter, Boolean, Other' comments in method files

Documented VehicleMethods, the rest of PlayerMethods, UnitMethods, CreatureMethods and GuildMethods.

Refer to #101 for more information
2015-09-16 04:14:32 -04:00

67 lines
1.5 KiB
C++

/*
* Copyright (C) 2010 - 2015 Eluna Lua Engine <http://emudevs.com/>
* This program is free software licensed under GPL version 3
* Please see the included DOCS/LICENSE.md for more information
*/
#include "Hooks.h"
#include "HookHelpers.h"
#include "LuaEngine.h"
#include "BindingMap.h"
#include "ElunaTemplate.h"
#ifndef CLASSIC
#ifndef TBC
using namespace Hooks;
#define START_HOOK(EVENT) \
if (!IsEnabled())\
return;\
auto key = EventKey<VehicleEvents>(EVENT);\
if (!VehicleEventBindings->HasBindingsFor(key))\
return;\
LOCK_ELUNA
void Eluna::OnInstall(Vehicle* vehicle)
{
START_HOOK(VEHICLE_EVENT_ON_INSTALL);
Push(vehicle);
CallAllFunctions(VehicleEventBindings, key);
}
void Eluna::OnUninstall(Vehicle* vehicle)
{
START_HOOK(VEHICLE_EVENT_ON_UNINSTALL);
Push(vehicle);
CallAllFunctions(VehicleEventBindings, key);
}
void Eluna::OnInstallAccessory(Vehicle* vehicle, Creature* accessory)
{
START_HOOK(VEHICLE_EVENT_ON_INSTALL_ACCESSORY);
Push(vehicle);
Push(accessory);
CallAllFunctions(VehicleEventBindings, key);
}
void Eluna::OnAddPassenger(Vehicle* vehicle, Unit* passenger, int8 seatId)
{
START_HOOK(VEHICLE_EVENT_ON_ADD_PASSENGER);
Push(vehicle);
Push(passenger);
Push(seatId);
CallAllFunctions(VehicleEventBindings, key);
}
void Eluna::OnRemovePassenger(Vehicle* vehicle, Unit* passenger)
{
START_HOOK(VEHICLE_EVENT_ON_REMOVE_PASSENGER);
Push(vehicle);
Push(passenger);
CallAllFunctions(VehicleEventBindings, key);
}
#endif // CLASSIC
#endif // TBC