summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-08-22 15:43:32 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-08-22 15:43:32 -0400
commit7020fee4324588a6d22ed423515cec9053eef3db (patch)
treec1d1cf6ce3a4b642bda358ebb05e9491cbf89707
parent3196c24604551745645f4737a67ecfebb416a4fc (diff)
pke-editor: EntType_Load don't pass placeholder
-rw-r--r--editor/editor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index c90fb08..2292066 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -328,12 +328,12 @@ void PkeEditor_Tick(double delta) {
strncpy(newEntType->createInstanceCallback.name, entityTypeToCreate.createInstanceCallback.name, CallbackSignatureLength);
PkePlugin_SetSignatureFunc(&newEntType->createInstanceCallback);
}
+ newEntType->detailsCount = entityTypeToCreate.detailsCount;
for (int64_t i = 0; i < entityTypeToCreate.detailsCount; ++i) {
newEntType->details[i] = entityTypeToCreate.details[i];
- strncpy(newEntType->details[i].textureAssetKey, entityTypeToCreate.details[i].textureAssetKey, AssetKeyLength);
}
- EntityType_Load(entityTypeToCreate);
+ EntityType_Load(*newEntType);
/*
for (int64_t i = 0; i < entityTypeToCreate.detailsCount; ++i) {
@@ -1586,12 +1586,12 @@ void RecordImGuiModalCreateEntityType() {
if (ImGui::Button("-")) {
entityTypeToCreate.detailsCount -= 1;
}
- entityTypeToCreate.detailsCount = entityTypeToCreate.detailsCount < 1 ? 1 : entityTypeToCreate.detailsCount;
ImGui::SameLine();
if (ImGui::Button("+")) {
entityTypeToCreate.detailsCount += 1;
- entityTypeToCreate.detailsCount = entityTypeToCreate.detailsCount > EntityTypeDetails_MAX ? EntityTypeDetails_MAX : entityTypeToCreate.detailsCount;
}
+ entityTypeToCreate.detailsCount = entityTypeToCreate.detailsCount < 1 ? 1 : entityTypeToCreate.detailsCount;
+ entityTypeToCreate.detailsCount = entityTypeToCreate.detailsCount > EntityTypeDetails_MAX ? EntityTypeDetails_MAX : entityTypeToCreate.detailsCount;
for (int64_t i = 0; i < entityTypeToCreate.detailsCount; ++i) {
auto &etd = entityTypeToCreate.details[i];