Use only 1 script component per Entity

Serialization won't make sense if we allow two of the same component like that
This commit is contained in:
David Markowitz
2023-06-12 04:13:06 -07:00
parent f9ac0a9dec
commit d224a86e93
3 changed files with 7 additions and 5 deletions

View File

@@ -10,7 +10,7 @@
#include "CDZoneTableTable.h"
#include "dZoneManager.h"
ScriptComponent::ScriptComponent(Entity* parent, std::string scriptName) : Component(parent) {
ScriptComponent::ScriptComponent(Entity* parent, const std::string& scriptName) : Component(parent) {
SetScript(scriptName);
}

View File

@@ -21,7 +21,7 @@ class ScriptComponent : public Component {
public:
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SCRIPT;
ScriptComponent(Entity* parent, std::string scriptName);
ScriptComponent(Entity* parent, const std::string& scriptName);
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);