Merge remote-tracking branch 'refs/remotes/origin/main'

Conflicts:
	dGame/EntityManager.cpp
	dGame/Player.h
	dGame/dComponents/RenderComponent.cpp
This commit is contained in:
wincent
2024-02-17 23:06:43 +01:00
278 changed files with 2439 additions and 2960 deletions

View File

@@ -13,13 +13,13 @@ public:
bUsedMouse = false;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
lastClickedPosit = NiPoint3Constant::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
originatorRot = NiQuaternionConstant::IDENTITY;
uiSkillHandle = 0;
}
EchoStartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, float _fCasterLatency = 0.0f, int32_t _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternion::IDENTITY, uint32_t _uiSkillHandle = 0) {
EchoStartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, float _fCasterLatency = 0.0f, int32_t _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3Constant::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternionConstant::IDENTITY, uint32_t _uiSkillHandle = 0) {
bUsedMouse = _bUsedMouse;
fCasterLatency = _fCasterLatency;
iCastType = _iCastType;
@@ -50,16 +50,16 @@ public:
stream->Write(iCastType != 0);
if (iCastType != 0) stream->Write(iCastType);
stream->Write(lastClickedPosit != NiPoint3::ZERO);
if (lastClickedPosit != NiPoint3::ZERO) stream->Write(lastClickedPosit);
stream->Write(lastClickedPosit != NiPoint3Constant::ZERO);
if (lastClickedPosit != NiPoint3Constant::ZERO) stream->Write(lastClickedPosit);
stream->Write(optionalOriginatorID);
stream->Write(optionalTargetID != LWOOBJID_EMPTY);
if (optionalTargetID != LWOOBJID_EMPTY) stream->Write(optionalTargetID);
stream->Write(originatorRot != NiQuaternion::IDENTITY);
if (originatorRot != NiQuaternion::IDENTITY) stream->Write(originatorRot);
stream->Write(originatorRot != NiQuaternionConstant::IDENTITY);
if (originatorRot != NiQuaternionConstant::IDENTITY) stream->Write(originatorRot);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);

View File

@@ -18,7 +18,6 @@
#include "Character.h"
#include "ControllablePhysicsComponent.h"
#include "dZoneManager.h"
#include "Player.h"
#include "CppScripts.h"
#include "CDClientDatabase.h"
@@ -291,7 +290,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
comp->Progress(eMissionTaskType::USE_SKILL, startSkill.skillID);
}
CDSkillBehaviorTable* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
CDSkillBehaviorTable* skillTable = CDClientManager::GetTable<CDSkillBehaviorTable>();
unsigned int behaviorId = skillTable->GetSkillByID(startSkill.skillID).behaviorID;
bool success = false;

View File

@@ -20,7 +20,6 @@
#include "WorldPackets.h"
#include "Item.h"
#include "ZCompression.h"
#include "Player.h"
#include "dConfig.h"
#include "TeamManager.h"
#include "ChatPackets.h"
@@ -393,8 +392,8 @@ void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAd
float fIdleTimeElapsed = 0.0f;
float fMoveTimeElapsed = 0.0f;
float fPercentBetweenPoints = 0.0f;
NiPoint3 ptUnexpectedLocation = NiPoint3::ZERO;
NiQuaternion qUnexpectedRotation = NiQuaternion::IDENTITY;
NiPoint3 ptUnexpectedLocation = NiPoint3Constant::ZERO;
NiQuaternion qUnexpectedRotation = NiQuaternionConstant::IDENTITY;
bitStream.Write(bReverse);
bitStream.Write(bStopAtDesiredWaypoint);
@@ -411,8 +410,8 @@ void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAd
bitStream.Write(ptUnexpectedLocation.y);
bitStream.Write(ptUnexpectedLocation.z);
bitStream.Write(qUnexpectedRotation != NiQuaternion::IDENTITY);
if (qUnexpectedRotation != NiQuaternion::IDENTITY) {
bitStream.Write(qUnexpectedRotation != NiQuaternionConstant::IDENTITY);
if (qUnexpectedRotation != NiQuaternionConstant::IDENTITY) {
bitStream.Write(qUnexpectedRotation.x);
bitStream.Write(qUnexpectedRotation.y);
bitStream.Write(qUnexpectedRotation.z);
@@ -633,6 +632,25 @@ void GameMessages::SendUIMessageServerToSingleClient(Entity* entity, const Syste
SEND_PACKET;
}
void GameMessages::SendUIMessageServerToSingleClient(const std::string& message, AMFBaseValue& args, const SystemAddress& sysAddr) {
CBITSTREAM;
CMSGHEADER;
LWOOBJID empty = 0;
bitStream.Write(empty);
bitStream.Write(eGameMessageType::UI_MESSAGE_SERVER_TO_ALL_CLIENTS); // This is intentional to allow the server to send a ui message to a client via their system address.
bitStream.Write<AMFBaseValue&>(args);
uint32_t strMessageNameLength = message.size();
bitStream.Write(strMessageNameLength);
for (uint32_t k = 0; k < strMessageNameLength; k++) {
bitStream.Write<char>(message[k]);
}
SEND_PACKET;
}
void GameMessages::SendUIMessageServerToAllClients(const std::string& message, AMFBaseValue& args) {
CBITSTREAM;
CMSGHEADER;
@@ -759,7 +777,7 @@ void GameMessages::SendSetCurrency(Entity* entity, int64_t currency, int lootTyp
bitStream.Write(lootType != LOOTTYPE_NONE);
if (lootType != LOOTTYPE_NONE) bitStream.Write(lootType);
bitStream.Write(NiPoint3::ZERO);
bitStream.Write(NiPoint3Constant::ZERO);
bitStream.Write(sourceLOT != LOT_NULL);
if (sourceLOT != LOT_NULL) bitStream.Write(sourceLOT);
@@ -1068,7 +1086,7 @@ void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID,
entity->RegisterCoinDrop(currency);
}
if (spawnPos != NiPoint3::ZERO) {
if (spawnPos != NiPoint3Constant::ZERO) {
bUsePosition = true;
//Calculate where the loot will go:
@@ -1090,8 +1108,8 @@ void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID,
bitStream.Write(bUsePosition);
bitStream.Write(finalPosition != NiPoint3::ZERO);
if (finalPosition != NiPoint3::ZERO) bitStream.Write(finalPosition);
bitStream.Write(finalPosition != NiPoint3Constant::ZERO);
if (finalPosition != NiPoint3Constant::ZERO) bitStream.Write(finalPosition);
bitStream.Write(currency);
bitStream.Write(item);
@@ -1099,14 +1117,14 @@ void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID,
bitStream.Write(owner);
bitStream.Write(sourceID);
bitStream.Write(spawnPos != NiPoint3::ZERO);
if (spawnPos != NiPoint3::ZERO) bitStream.Write(spawnPos);
bitStream.Write(spawnPos != NiPoint3Constant::ZERO);
if (spawnPos != NiPoint3Constant::ZERO) bitStream.Write(spawnPos);
auto* team = TeamManager::Instance()->GetTeam(owner);
// Currency and powerups should not sync
if (team != nullptr && currency == 0) {
CDObjectsTable* objectsTable = CDClientManager::Instance().GetTable<CDObjectsTable>();
CDObjectsTable* objectsTable = CDClientManager::GetTable<CDObjectsTable>();
const CDObjects& object = objectsTable->GetByID(item);
@@ -1159,7 +1177,7 @@ void GameMessages::SendPlayerReachedRespawnCheckpoint(Entity* entity, const NiPo
bitStream.Write(position.y);
bitStream.Write(position.z);
const bool bIsNotIdentity = rotation != NiQuaternion::IDENTITY;
const bool bIsNotIdentity = rotation != NiQuaternionConstant::IDENTITY;
bitStream.Write(bIsNotIdentity);
if (bIsNotIdentity) {
@@ -1635,8 +1653,8 @@ void GameMessages::SendNotifyClientShootingGalleryScore(LWOOBJID objectId, const
void GameMessages::HandleUpdateShootingGalleryRotation(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
float angle = 0.0f;
NiPoint3 facing = NiPoint3::ZERO;
NiPoint3 muzzlePos = NiPoint3::ZERO;
NiPoint3 facing = NiPoint3Constant::ZERO;
NiPoint3 muzzlePos = NiPoint3Constant::ZERO;
inStream->Read(angle);
inStream->Read(facing);
inStream->Read(muzzlePos);
@@ -2092,8 +2110,8 @@ void GameMessages::SendPlaceModelResponse(LWOOBJID objectId, const SystemAddress
bitStream.Write(objectId);
bitStream.Write(eGameMessageType::PLACE_MODEL_RESPONSE);
bitStream.Write(position != NiPoint3::ZERO);
if (position != NiPoint3::ZERO) {
bitStream.Write(position != NiPoint3Constant::ZERO);
if (position != NiPoint3Constant::ZERO) {
bitStream.Write(position);
}
@@ -2107,8 +2125,8 @@ void GameMessages::SendPlaceModelResponse(LWOOBJID objectId, const SystemAddress
bitStream.Write(response);
}
bitStream.Write(rotation != NiQuaternion::IDENTITY);
if (rotation != NiQuaternion::IDENTITY) {
bitStream.Write(rotation != NiQuaternionConstant::IDENTITY);
if (rotation != NiQuaternionConstant::IDENTITY) {
bitStream.Write(response);
}
@@ -2260,7 +2278,7 @@ void GameMessages::HandleSetBuildMode(RakNet::BitStream* inStream, Entity* entit
bool modePaused{};
int modeValue = 1;
LWOOBJID playerId{};
NiPoint3 startPosition = NiPoint3::ZERO;
NiPoint3 startPosition = NiPoint3Constant::ZERO;
inStream->Read(start);
@@ -2279,7 +2297,7 @@ void GameMessages::HandleSetBuildMode(RakNet::BitStream* inStream, Entity* entit
auto* player = Game::entityManager->GetEntity(playerId);
if (startPosition == NiPoint3::ZERO) {
if (startPosition == NiPoint3Constant::ZERO) {
startPosition = player->GetPosition();
}
@@ -2373,13 +2391,13 @@ void GameMessages::HandlePlacePropertyModel(RakNet::BitStream* inStream, Entity*
inStream->Read(model);
PropertyManagementComponent::Instance()->UpdateModelPosition(model, NiPoint3::ZERO, NiQuaternion::IDENTITY);
PropertyManagementComponent::Instance()->UpdateModelPosition(model, NiPoint3Constant::ZERO, NiQuaternionConstant::IDENTITY);
}
void GameMessages::HandleUpdatePropertyModel(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
LWOOBJID model;
NiPoint3 position;
NiQuaternion rotation = NiQuaternion::IDENTITY;
NiQuaternion rotation = NiQuaternionConstant::IDENTITY;
inStream->Read(model);
inStream->Read(position);
@@ -2573,6 +2591,7 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream* inStream, Entity* ent
//We need to get a new ID for our model first:
ObjectIDManager::RequestPersistentID([=](uint32_t newID) {
if (!entity || !entity->GetCharacter() || !entity->GetCharacter()->GetParentUser()) return;
LWOOBJID newIDL = newID;
GeneralUtils::SetBit(newIDL, eObjectBits::CHARACTER);
GeneralUtils::SetBit(newIDL, eObjectBits::PERSISTENT);
@@ -2595,13 +2614,13 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream* inStream, Entity* ent
//Insert into ugc:
std::string str(sd0Data.get(), sd0Size);
std::istringstream sd0DataStream(str);
Database::Get()->InsertNewUgcModel(sd0DataStream, blueprintIDSmall, entity->GetParentUser()->GetAccountID(), entity->GetCharacter()->GetID());
Database::Get()->InsertNewUgcModel(sd0DataStream, blueprintIDSmall, entity->GetCharacter()->GetParentUser()->GetAccountID(), entity->GetCharacter()->GetID());
//Insert into the db as a BBB model:
IPropertyContents::Model model;
model.id = newIDL;
model.ugcId = blueprintIDSmall;
model.position = NiPoint3::ZERO;
model.position = NiPoint3Constant::ZERO;
model.rotation = NiQuaternion(0.0f, 0.0f, 0.0f, 0.0f);
model.lot = 14;
Database::Get()->InsertNewPropertyModel(propertyId, model, "Objects_14_name");
@@ -3259,7 +3278,7 @@ void GameMessages::HandleClientTradeRequest(RakNet::BitStream* inStream, Entity*
if (trade != nullptr) {
if (!trade->IsParticipant(i64Invitee)) {
TradingManager::Instance()->CancelTrade(trade->GetTradeId());
TradingManager::Instance()->CancelTrade(entity->GetObjectID(), trade->GetTradeId());
TradingManager::Instance()->NewTrade(entity->GetObjectID(), i64Invitee);
}
@@ -3284,7 +3303,7 @@ void GameMessages::HandleClientTradeCancel(RakNet::BitStream* inStream, Entity*
LOG("Trade canceled from (%llu)", entity->GetObjectID());
TradingManager::Instance()->CancelTrade(trade->GetTradeId());
TradingManager::Instance()->CancelTrade(entity->GetObjectID(), trade->GetTradeId());
}
void GameMessages::HandleClientTradeAccept(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
@@ -3382,7 +3401,7 @@ void GameMessages::SendNotifyPetTamingMinigame(LWOOBJID objectId, LWOOBJID petId
bitStream.Write(petsDestPos);
bitStream.Write(telePos);
const bool hasDefault = teleRot != NiQuaternion::IDENTITY;
const bool hasDefault = teleRot != NiQuaternionConstant::IDENTITY;
bitStream.Write(hasDefault);
if (hasDefault) bitStream.Write(teleRot);
@@ -4207,7 +4226,7 @@ void GameMessages::HandleVehicleNotifyHitImaginationServer(RakNet::BitStream* in
LWOOBJID pickupObjID = LWOOBJID_EMPTY;
LWOOBJID pickupSpawnerID = LWOOBJID_EMPTY;
int32_t pickupSpawnerIndex = -1;
NiPoint3 vehiclePosition = NiPoint3::ZERO;
NiPoint3 vehiclePosition = NiPoint3Constant::ZERO;
if (inStream->ReadBit()) inStream->Read(pickupObjID);
if (inStream->ReadBit()) inStream->Read(pickupSpawnerID);
@@ -4675,8 +4694,8 @@ void GameMessages::HandleBuyFromVendor(RakNet::BitStream* inStream, Entity* enti
return;
}
CDComponentsRegistryTable* compRegistryTable = CDClientManager::Instance().GetTable<CDComponentsRegistryTable>();
CDItemComponentTable* itemComponentTable = CDClientManager::Instance().GetTable<CDItemComponentTable>();
CDComponentsRegistryTable* compRegistryTable = CDClientManager::GetTable<CDComponentsRegistryTable>();
CDItemComponentTable* itemComponentTable = CDClientManager::GetTable<CDItemComponentTable>();
int itemCompID = compRegistryTable->GetByIDAndType(item, eReplicaComponentType::ITEM);
CDItemComponent itemComp = itemComponentTable->GetItemComponentByID(itemCompID);
@@ -4767,8 +4786,8 @@ void GameMessages::HandleSellToVendor(RakNet::BitStream* inStream, Entity* entit
Item* item = inv->FindItemById(iObjID);
if (!item) return;
CDComponentsRegistryTable* compRegistryTable = CDClientManager::Instance().GetTable<CDComponentsRegistryTable>();
CDItemComponentTable* itemComponentTable = CDClientManager::Instance().GetTable<CDItemComponentTable>();
CDComponentsRegistryTable* compRegistryTable = CDClientManager::GetTable<CDComponentsRegistryTable>();
CDItemComponentTable* itemComponentTable = CDClientManager::GetTable<CDItemComponentTable>();
int itemCompID = compRegistryTable->GetByIDAndType(item->GetLot(), eReplicaComponentType::ITEM);
CDItemComponent itemComp = itemComponentTable->GetItemComponentByID(itemCompID);
@@ -4817,8 +4836,8 @@ void GameMessages::HandleBuybackFromVendor(RakNet::BitStream* inStream, Entity*
Item* item = inv->FindItemById(iObjID);
if (!item) return;
CDComponentsRegistryTable* compRegistryTable = CDClientManager::Instance().GetTable<CDComponentsRegistryTable>();
CDItemComponentTable* itemComponentTable = CDClientManager::Instance().GetTable<CDItemComponentTable>();
CDComponentsRegistryTable* compRegistryTable = CDClientManager::GetTable<CDComponentsRegistryTable>();
CDItemComponentTable* itemComponentTable = CDClientManager::GetTable<CDItemComponentTable>();
int itemCompID = compRegistryTable->GetByIDAndType(item->GetLot(), eReplicaComponentType::ITEM);
CDItemComponent itemComp = itemComponentTable->GetItemComponentByID(itemCompID);
@@ -5030,7 +5049,7 @@ void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity)
if (emoteID == 0) return;
std::string sAnimationName = "deaded"; //Default name in case we fail to get the emote
CDEmoteTableTable* emotes = CDClientManager::Instance().GetTable<CDEmoteTableTable>();
CDEmoteTableTable* emotes = CDClientManager::GetTable<CDEmoteTableTable>();
if (emotes) {
CDEmoteTable* emote = emotes->GetEmote(emoteID);
if (emote) sAnimationName = emote->animationName;
@@ -5099,13 +5118,8 @@ void GameMessages::HandleSetFlag(RakNet::BitStream* inStream, Entity* entity) {
inStream->Read(bFlag);
inStream->Read(iFlagID);
auto user = entity->GetParentUser();
if (user) {
auto character = user->GetLastUsedChar();
if (!character) return;
character->SetPlayerFlag(iFlagID, bFlag);
}
auto character = entity->GetCharacter();
if (character) character->SetPlayerFlag(iFlagID, bFlag);
}
void GameMessages::HandleRespondToMission(RakNet::BitStream* inStream, Entity* entity) {

View File

@@ -55,14 +55,14 @@ namespace GameMessages {
const SystemAddress& sysAddr,
bool bFirstTime = true,
const LWOOBJID& buildAreaID = LWOOBJID_EMPTY,
NiPoint3 buildStartPOS = NiPoint3::ZERO,
NiPoint3 buildStartPOS = NiPoint3Constant::ZERO,
int sourceBAG = 0,
const LWOOBJID& sourceID = LWOOBJID_EMPTY,
LOT sourceLOT = 0,
int sourceTYPE = 8,
const LWOOBJID& targetID = 0,
LOT targetLOT = 0,
NiPoint3 targetPOS = NiPoint3::ZERO,
NiPoint3 targetPOS = NiPoint3Constant::ZERO,
int targetTYPE = 0
);
@@ -92,6 +92,9 @@ namespace GameMessages {
void SendModifyLEGOScore(Entity* entity, const SystemAddress& sysAddr, int64_t score, eLootSourceType sourceType);
void SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, AMFBaseValue& args);
// Specify sysAddr if you need to send a flash message to a client who you dont know the objectID of.
void SendUIMessageServerToSingleClient(const std::string& message, AMFBaseValue& args, const SystemAddress& sysAddr);
void SendUIMessageServerToAllClients(const std::string& message, AMFBaseValue& args);
void SendPlayEmbeddedEffectOnAllClientsNearObject(Entity* entity, std::u16string effectName, const LWOOBJID& fromObjectID, float radius);
@@ -119,7 +122,7 @@ namespace GameMessages {
void SendStop2DAmbientSound(Entity* entity, bool force, std::string audioGUID, bool result = false);
void SendPlay2DAmbientSound(Entity* entity, std::string audioGUID, bool result = false);
void SendSetNetworkScriptVar(Entity* entity, const SystemAddress& sysAddr, std::string data);
void SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID, LOT item, int currency, NiPoint3 spawnPos = NiPoint3::ZERO, int count = 1);
void SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID, LOT item, int currency, NiPoint3 spawnPos = NiPoint3Constant::ZERO, int count = 1);
void SendSetPlayerControlScheme(Entity* entity, eControlScheme controlScheme);
void SendPlayerReachedRespawnCheckpoint(Entity* entity, const NiPoint3& position, const NiQuaternion& rotation);
@@ -236,7 +239,7 @@ namespace GameMessages {
void SendLockNodeRotation(Entity* entity, std::string nodeName);
void SendSetBuildModeConfirmed(LWOOBJID objectId, const SystemAddress& sysAddr, bool start, bool warnVisitors, bool modePaused, int32_t modeValue, LWOOBJID playerId, NiPoint3 startPos = NiPoint3::ZERO);
void SendSetBuildModeConfirmed(LWOOBJID objectId, const SystemAddress& sysAddr, bool start, bool warnVisitors, bool modePaused, int32_t modeValue, LWOOBJID playerId, NiPoint3 startPos = NiPoint3Constant::ZERO);
void SendGetModelsOnProperty(LWOOBJID objectId, std::map<LWOOBJID, LWOOBJID> models, const SystemAddress& sysAddr);

View File

@@ -103,7 +103,7 @@ void GameMessages::PropertyDataMessage::Serialize(RakNet::BitStream& stream) con
}
GameMessages::PropertyDataMessage::PropertyDataMessage(uint32_t mapID) {
const auto propertyTemplate = CDClientManager::Instance().GetTable<CDPropertyTemplateTable>()->GetByMapID(mapID);
const auto propertyTemplate = CDClientManager::GetTable<CDPropertyTemplateTable>()->GetByMapID(mapID);
TemplateID = propertyTemplate.id;
ZoneId = propertyTemplate.mapID;

View File

@@ -16,13 +16,13 @@ public:
consumableItemID = LWOOBJID_EMPTY;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
lastClickedPosit = NiPoint3Constant::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
originatorRot = NiQuaternionConstant::IDENTITY;
uiSkillHandle = 0;
}
StartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, LWOOBJID _consumableItemID = LWOOBJID_EMPTY, float _fCasterLatency = 0.0f, int32_t _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternion::IDENTITY, uint32_t _uiSkillHandle = 0) {
StartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, LWOOBJID _consumableItemID = LWOOBJID_EMPTY, float _fCasterLatency = 0.0f, int32_t _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3Constant::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternionConstant::IDENTITY, uint32_t _uiSkillHandle = 0) {
bUsedMouse = _bUsedMouse;
consumableItemID = _consumableItemID;
fCasterLatency = _fCasterLatency;
@@ -57,16 +57,16 @@ public:
stream->Write(iCastType != 0);
if (iCastType != 0) stream->Write(iCastType);
stream->Write(lastClickedPosit != NiPoint3::ZERO);
if (lastClickedPosit != NiPoint3::ZERO) stream->Write(lastClickedPosit);
stream->Write(lastClickedPosit != NiPoint3Constant::ZERO);
if (lastClickedPosit != NiPoint3Constant::ZERO) stream->Write(lastClickedPosit);
stream->Write(optionalOriginatorID);
stream->Write(optionalTargetID != LWOOBJID_EMPTY);
if (optionalTargetID != LWOOBJID_EMPTY) stream->Write(optionalTargetID);
stream->Write(originatorRot != NiQuaternion::IDENTITY);
if (originatorRot != NiQuaternion::IDENTITY) stream->Write(originatorRot);
stream->Write(originatorRot != NiQuaternionConstant::IDENTITY);
if (originatorRot != NiQuaternionConstant::IDENTITY) stream->Write(originatorRot);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);