From 39d315293a7e9043a6a1544b29c5195d1f5b2f22 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 23 Jan 2023 19:50:00 -0700 Subject: [PATCH] fixed crashing bug, collect npc shimmer data but dont use it --- config/config.xml | 2 +- debian/changelog | 6 ++++++ glmap.cpp | 2 +- main.cpp | 2 +- mainwindow.cpp | 2 +- packages/com.seancode.terrafirma/meta/package.xml | 4 ++-- res/header.json | 2 +- world.cpp | 8 +++++++- world.h | 1 + 9 files changed, 21 insertions(+), 8 deletions(-) diff --git a/config/config.xml b/config/config.xml index 410ae2b..a00c3d3 100644 --- a/config/config.xml +++ b/config/config.xml @@ -1,7 +1,7 @@ Terrafirma - 3.1.10 + 3.1.11 Terrafirma Installer Sean Kasun Terrafirma diff --git a/debian/changelog b/debian/changelog index e6e9192..4b1b604 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +terrafirma (3.1.11) focal; urgency=medium + + * Fixed crash in 1.4.4.9 + + -- Sean Kasun Mon, 23 Jan 2023 19:44:05 -0700 + terrafirma (3.1.10) focal; urgency=medium * Updated for 1.4.4.9 diff --git a/glmap.cpp b/glmap.cpp index e7ce910..2501211 100644 --- a/glmap.cpp +++ b/glmap.cpp @@ -1100,7 +1100,7 @@ void GLMap::drawNPCs() { 0, 56, 0, 0, 5.5f, 0, false); } } - if (houses && npc.head != 0) { + if (houses && npc.head != 0 && !npc.homeless) { int hx = npc.homeX; int hy = npc.homeY - 1; int offset = hy * stride + hx; diff --git a/main.cpp b/main.cpp index 1712b7b..eae39fa 100644 --- a/main.cpp +++ b/main.cpp @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) { QApplication::installTranslator(&translator); QApplication::setApplicationName("Terrafirma"); - QApplication::setApplicationVersion("3.1.10"); + QApplication::setApplicationVersion("3.1.11"); QApplication::setOrganizationName("seancode"); MainWindow w; diff --git a/mainwindow.cpp b/mainwindow.cpp index 17d2019..0baf382 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -201,7 +201,7 @@ void MainWindow::setNPCs(bool loaded) { name = tr("%1 the %2").arg(npc.name).arg(l10n->xlateNPC(npc.title)); if (npc.homeless) { n->setText(tr("Jump to %1's Location").arg(name)); - n->setData(QPointF(npc.x, npc.y)); + n->setData(QPointF(npc.x / 16.0, npc.y / 16.0)); } else { n->setText(tr("Jump to %1's Home").arg(name)); n->setData(QPointF(npc.homeX, npc.homeY)); diff --git a/packages/com.seancode.terrafirma/meta/package.xml b/packages/com.seancode.terrafirma/meta/package.xml index 29fa38b..fe34015 100644 --- a/packages/com.seancode.terrafirma/meta/package.xml +++ b/packages/com.seancode.terrafirma/meta/package.xml @@ -2,8 +2,8 @@ Terrafirma Terraria mapping software - 3.1.10 - 2023-01-22 + 3.1.11 + 2023-01-23 true true diff --git a/res/header.json b/res/header.json index d9b47be..ee732f1 100644 --- a/res/header.json +++ b/res/header.json @@ -1 +1 @@ -[{"name":"title","type":"s"},{"min":179,"name":"seed","type":"s"},{"min":179,"name":"genVersion","type":"i64"},{"min":181,"name":"guid","num":16,"type":"u8"},{"name":"worldID","type":"i32"},{"name":"left","type":"i32"},{"name":"right","type":"i32"},{"name":"top","type":"i32"},{"name":"bottom","type":"i32"},{"name":"tilesHigh","type":"i32"},{"name":"tilesWide","type":"i32"},{"min":209,"name":"gameMode","type":"i32"},{"min":222,"name":"drunkWorld","type":"b"},{"min":227,"name":"goodWorld","type":"b"},{"min":238,"name":"tenthAnniversaryWorld ","type":"b"},{"min":239,"name":"dontStarveWorld","type":"b"},{"min":241,"name":"notTheBeesWorld","type":"b"},{"min":249,"name":"remixWorld","type":"b"},{"min":266,"name":"noTrapsWorld","type":"b"},{"min":267,"name":"zenithWorld","type":"b"},{"min":141,"name":"creationTime","type":"i64"},{"name":"moonType","type":"u8"},{"name":"treeX","num":3,"type":"i32"},{"name":"treeStyle","num":4,"type":"i32"},{"name":"caveBackX","num":3,"type":"i32"},{"name":"caveBackStyle","num":4,"type":"i32"},{"name":"iceBackStyle","type":"i32"},{"name":"jungleBackStyle","type":"i32"},{"name":"hellBackStyle","type":"i32"},{"name":"spawnX","type":"i32"},{"name":"spawnY","type":"i32"},{"name":"groundLevel","type":"f64"},{"name":"rockLevel","type":"f64"},{"name":"gameTIme","type":"f64"},{"name":"dayNight"},{"name":"moonPhase","type":"i32"},{"name":"bloodMoon"},{"name":"eclipse"},{"name":"dungeonX","type":"i32"},{"name":"dungeonY","type":"i32"},{"name":"crimson"},{"name":"killedBoss1"},{"name":"killedBoss2"},{"name":"killedBoss3"},{"name":"killedQueenBee"},{"name":"killedMechBoss1"},{"name":"killedMechBoss2"},{"name":"killedMechBoss3"},{"name":"killedMechBossAny"},{"name":"killedPlantBoss"},{"name":"killedGolemBoss"},{"min":118,"name":"killedSlimeKing"},{"name":"savedTinkerer"},{"name":"savedWizard"},{"name":"savedMechanic"},{"name":"killedGoblins","type":"b"},{"name":"killedClown","type":"b"},{"name":"killedFrost"},{"name":"killedPirates","type":"b"},{"name":"smashedOrb","type":"b"},{"name":"meteorSpawned","type":"b"},{"name":"shadowOrbCount","type":"u8"},{"name":"altarsSmashed","type":"i32"},{"name":"hardMode","type":"b"},{"name":"invasionDelay","type":"i32"},{"name":"invasionSize","type":"i32"},{"name":"invasionType","type":"i32"},{"name":"invasionX","type":"f64"},{"min":118,"name":"slimeRainTime","type":"f64"},{"min":113,"name":"sundialCooldown","type":"u8"},{"name":"isRaining","type":"b"},{"name":"rainTime","type":"i32"},{"name":"maxRain","type":"f32"},{"name":"oreTier1","type":"i32"},{"name":"oreTier2","type":"i32"},{"name":"oreTier3","type":"i32"},{"name":"styles","num":8,"type":"u8"},{"name":"clouds","type":"i32"},{"name":"numClouds","type":"i16"},{"name":"windSpeed","type":"f32"},{"min":95,"name":"numAnglers","type":"i32"},{"min":95,"name":"anglers","relnum":"numAnglers","type":"s"},{"min":99,"name":"savedAngler","type":"b"},{"min":101,"name":"anglerQuest","type":"i32"},{"min":104,"name":"savedStylist"},{"min":129,"name":"savedTaxCollector"},{"min":201,"name":"savedGolfer"},{"min":107,"name":"invasionSizeStart","type":"i32"},{"min":108,"name":"cultistDelay","type":"i32"},{"min":109,"name":"numKilled","type":"i16"},{"min":109,"name":"killCount","relnum":"numKilled","type":"i32"},{"min":128,"name":"fastForwardTime"},{"min":131,"name":"downedFishron"},{"min":131,"name":"downedMartians"},{"min":131,"name":"downedAncientCultist"},{"min":131,"name":"downedMoonlord"},{"min":131,"name":"downedHalloweenKing"},{"min":131,"name":"downedHalloweenTree"},{"min":131,"name":"downedIceQueen"},{"min":131,"name":"downedChristmasSantank"},{"min":131,"name":"downedChristmasTree"},{"min":140,"name":"downedSolar"},{"min":140,"name":"downedVortex"},{"min":140,"name":"downedNebula"},{"min":140,"name":"downedStardust"},{"min":140,"name":"activeSolar"},{"min":140,"name":"activeVortex","type":"b"},{"min":140,"name":"activeNebula","type":"b"},{"min":140,"name":"activeStardust","type":"b"},{"min":140,"name":"lunarApocalypse"},{"min":170,"name":"partyManual","type":"b"},{"min":170,"name":"partyGenuine","type":"b"},{"min":170,"name":"partyCooldown","type":"i32"},{"min":170,"name":"numPartiers","type":"i32"},{"min":170,"name":"partiers","relnum":"numPartiers","type":"i32"},{"min":174,"name":"sandstormHappening"},{"min":174,"name":"sandstormTimeLeft","type":"i32"},{"min":174,"name":"sandstormSeverity","type":"f32"},{"min":174,"name":"sandstormIntendedSeverity","type":"f32"},{"min":178,"name":"savedBartender"},{"min":178,"name":"downedDD2Invasion1"},{"min":178,"name":"downedDD2Invasion2"},{"min":178,"name":"downedDD2Invasion3"},{"min":195,"name":"style8","type":"u8"},{"min":215,"name":"style9","type":"u8"},{"min":196,"name":"styles10","num":3,"type":"u8"},{"min":204,"name":"combatBookWasUsed"},{"min":207,"name":"lanternNightCooldown","type":"i32"},{"min":207,"name":"lanternNightGenuine"},{"min":207,"name":"lanternNightManual"},{"min":207,"name":"lanternNightNextGenuine"},{"min":211,"name":"numTreeTop","type":"i32"},{"min":211,"name":"treeTops","relnum":"numTreeTop","type":"i32"},{"min":212,"name":"forceHalloween"},{"min":212,"name":"forceXMas","type":"b"},{"min":216,"name":"copper","type":"i32"},{"min":216,"name":"iron","type":"i32"},{"min":216,"name":"silver","type":"i32"},{"min":216,"name":"gold","type":"i32"},{"min":217,"name":"boughtCat"},{"min":217,"name":"boughtDog"},{"min":217,"name":"boughtBunny"},{"min":223,"name":"killedEmpressOfLight"},{"min":223,"name":"killedQueenSlime"},{"min":240,"name":"killedDeerClops"},{"min":250,"name":"unlockedSlimeBlueSpawn","type":"b"},{"min":251,"name":"unlockedMerchantSpawn","type":"b"},{"min":251,"name":"unlockedDemolitionistSpawn","type":"b"},{"min":251,"name":"unlockedPartyGirlSpawn","type":"b"},{"min":251,"name":"unlockedDyeTraderSpawn","type":"b"},{"min":251,"name":"unlockedTruffleSpawn","type":"b"},{"min":251,"name":"unlockedArmsDealerSpawn","type":"b"},{"min":251,"name":"unlockedNurseSpawn","type":"b"},{"min":251,"name":"unlockedPrincessSpawn","type":"b"},{"min":259,"name":"combatBookVolumeTwoWasUsed","type":"b"},{"min":260,"name":"peddlersSatchelWasUsed","type":"b"},{"min":261,"name":"unlockedSlimeGreenSpawn","type":"b"},{"min":261,"name":"unlockedSlimeOldSpawn","type":"b"},{"min":261,"name":"unlockedSlimePurpleSpawn","type":"b"},{"min":261,"name":"unlockedSlimeRainbowSpawn","type":"b"},{"min":261,"name":"unlockedSlimeRedSpawn","type":"b"},{"min":261,"name":"unlockedSlimeYellowSpawn","type":"b"},{"min":261,"name":"unlockedSlimeCopperSpawn","type":"b"},{"min":264,"name":"fastForwardTimeToDusk","type":"b"},{"min":264,"name":"moondialCooldown","type":"u8"}] \ No newline at end of file +[{"name":"title","type":"s"},{"min":179,"name":"seed","type":"s"},{"min":179,"name":"genVersion","type":"i64"},{"min":181,"name":"guid","num":16,"type":"u8"},{"name":"worldID","type":"i32"},{"name":"left","type":"i32"},{"name":"right","type":"i32"},{"name":"top","type":"i32"},{"name":"bottom","type":"i32"},{"name":"tilesHigh","type":"i32"},{"name":"tilesWide","type":"i32"},{"min":209,"name":"gameMode","type":"i32"},{"min":222,"name":"drunkWorld","type":"b"},{"min":227,"name":"goodWorld","type":"b"},{"min":238,"name":"tenthAnniversaryWorld ","type":"b"},{"min":239,"name":"dontStarveWorld","type":"b"},{"min":241,"name":"notTheBeesWorld","type":"b"},{"min":249,"name":"remixWorld","type":"b"},{"min":266,"name":"noTrapsWorld","type":"b"},{"min":267,"name":"zenithWorld","type":"b"},{"min":141,"name":"creationTime","type":"i64"},{"name":"moonType","type":"u8"},{"name":"treeX","num":3,"type":"i32"},{"name":"treeStyle","num":4,"type":"i32"},{"name":"caveBackX","num":3,"type":"i32"},{"name":"caveBackStyle","num":4,"type":"i32"},{"name":"iceBackStyle","type":"i32"},{"name":"jungleBackStyle","type":"i32"},{"name":"hellBackStyle","type":"i32"},{"name":"spawnX","type":"i32"},{"name":"spawnY","type":"i32"},{"name":"groundLevel","type":"f64"},{"name":"rockLevel","type":"f64"},{"name":"gameTIme","type":"f64"},{"name":"dayNight"},{"name":"moonPhase","type":"i32"},{"name":"bloodMoon"},{"name":"eclipse"},{"name":"dungeonX","type":"i32"},{"name":"dungeonY","type":"i32"},{"name":"crimson"},{"name":"killedBoss1"},{"name":"killedBoss2"},{"name":"killedBoss3"},{"name":"killedQueenBee"},{"name":"killedMechBoss1"},{"name":"killedMechBoss2"},{"name":"killedMechBoss3"},{"name":"killedMechBossAny"},{"name":"killedPlantBoss"},{"name":"killedGolemBoss"},{"min":118,"name":"killedSlimeKing"},{"name":"savedTinkerer"},{"name":"savedWizard"},{"name":"savedMechanic"},{"name":"killedGoblins","type":"b"},{"name":"killedClown","type":"b"},{"name":"killedFrost"},{"name":"killedPirates","type":"b"},{"name":"smashedOrb","type":"b"},{"name":"meteorSpawned","type":"b"},{"name":"shadowOrbCount","type":"u8"},{"name":"altarsSmashed","type":"i32"},{"name":"hardMode","type":"b"},{"min":257,"name":"afterPartyOfDoom","type":"b"},{"name":"invasionDelay","type":"i32"},{"name":"invasionSize","type":"i32"},{"name":"invasionType","type":"i32"},{"name":"invasionX","type":"f64"},{"min":118,"name":"slimeRainTime","type":"f64"},{"min":113,"name":"sundialCooldown","type":"u8"},{"name":"isRaining","type":"b"},{"name":"rainTime","type":"i32"},{"name":"maxRain","type":"f32"},{"name":"oreTier1","type":"i32"},{"name":"oreTier2","type":"i32"},{"name":"oreTier3","type":"i32"},{"name":"styles","num":8,"type":"u8"},{"name":"clouds","type":"i32"},{"name":"numClouds","type":"i16"},{"name":"windSpeed","type":"f32"},{"min":95,"name":"numAnglers","type":"i32"},{"min":95,"name":"anglers","relnum":"numAnglers","type":"s"},{"min":99,"name":"savedAngler","type":"b"},{"min":101,"name":"anglerQuest","type":"i32"},{"min":104,"name":"savedStylist"},{"min":129,"name":"savedTaxCollector"},{"min":201,"name":"savedGolfer"},{"min":107,"name":"invasionSizeStart","type":"i32"},{"min":108,"name":"cultistDelay","type":"i32"},{"min":109,"name":"numKilled","type":"i16"},{"min":109,"name":"killCount","relnum":"numKilled","type":"i32"},{"min":128,"name":"fastForwardTime"},{"min":131,"name":"downedFishron"},{"min":131,"name":"downedMartians"},{"min":131,"name":"downedAncientCultist"},{"min":131,"name":"downedMoonlord"},{"min":131,"name":"downedHalloweenKing"},{"min":131,"name":"downedHalloweenTree"},{"min":131,"name":"downedIceQueen"},{"min":131,"name":"downedChristmasSantank"},{"min":131,"name":"downedChristmasTree"},{"min":140,"name":"downedSolar"},{"min":140,"name":"downedVortex"},{"min":140,"name":"downedNebula"},{"min":140,"name":"downedStardust"},{"min":140,"name":"activeSolar"},{"min":140,"name":"activeVortex","type":"b"},{"min":140,"name":"activeNebula","type":"b"},{"min":140,"name":"activeStardust","type":"b"},{"min":140,"name":"lunarApocalypse"},{"min":170,"name":"partyManual","type":"b"},{"min":170,"name":"partyGenuine","type":"b"},{"min":170,"name":"partyCooldown","type":"i32"},{"min":170,"name":"numPartiers","type":"i32"},{"min":170,"name":"partiers","relnum":"numPartiers","type":"i32"},{"min":174,"name":"sandstormHappening"},{"min":174,"name":"sandstormTimeLeft","type":"i32"},{"min":174,"name":"sandstormSeverity","type":"f32"},{"min":174,"name":"sandstormIntendedSeverity","type":"f32"},{"min":178,"name":"savedBartender"},{"min":178,"name":"downedDD2Invasion1"},{"min":178,"name":"downedDD2Invasion2"},{"min":178,"name":"downedDD2Invasion3"},{"min":195,"name":"style8","type":"u8"},{"min":215,"name":"style9","type":"u8"},{"min":196,"name":"styles10","num":3,"type":"u8"},{"min":204,"name":"combatBookWasUsed"},{"min":207,"name":"lanternNightCooldown","type":"i32"},{"min":207,"name":"lanternNightGenuine"},{"min":207,"name":"lanternNightManual"},{"min":207,"name":"lanternNightNextGenuine"},{"min":211,"name":"numTreeTop","type":"i32"},{"min":211,"name":"treeTops","relnum":"numTreeTop","type":"i32"},{"min":212,"name":"forceHalloween"},{"min":212,"name":"forceXMas","type":"b"},{"min":216,"name":"copper","type":"i32"},{"min":216,"name":"iron","type":"i32"},{"min":216,"name":"silver","type":"i32"},{"min":216,"name":"gold","type":"i32"},{"min":217,"name":"boughtCat"},{"min":217,"name":"boughtDog"},{"min":217,"name":"boughtBunny"},{"min":223,"name":"killedEmpressOfLight"},{"min":223,"name":"killedQueenSlime"},{"min":240,"name":"killedDeerClops"},{"min":250,"name":"unlockedSlimeBlueSpawn","type":"b"},{"min":251,"name":"unlockedMerchantSpawn","type":"b"},{"min":251,"name":"unlockedDemolitionistSpawn","type":"b"},{"min":251,"name":"unlockedPartyGirlSpawn","type":"b"},{"min":251,"name":"unlockedDyeTraderSpawn","type":"b"},{"min":251,"name":"unlockedTruffleSpawn","type":"b"},{"min":251,"name":"unlockedArmsDealerSpawn","type":"b"},{"min":251,"name":"unlockedNurseSpawn","type":"b"},{"min":251,"name":"unlockedPrincessSpawn","type":"b"},{"min":259,"name":"combatBookVolumeTwoWasUsed","type":"b"},{"min":260,"name":"peddlersSatchelWasUsed","type":"b"},{"min":261,"name":"unlockedSlimeGreenSpawn","type":"b"},{"min":261,"name":"unlockedSlimeOldSpawn","type":"b"},{"min":261,"name":"unlockedSlimePurpleSpawn","type":"b"},{"min":261,"name":"unlockedSlimeRainbowSpawn","type":"b"},{"min":261,"name":"unlockedSlimeRedSpawn","type":"b"},{"min":261,"name":"unlockedSlimeYellowSpawn","type":"b"},{"min":261,"name":"unlockedSlimeCopperSpawn","type":"b"},{"min":264,"name":"fastForwardTimeToDusk","type":"b"},{"min":264,"name":"moondialCooldown","type":"u8"}] \ No newline at end of file diff --git a/world.cpp b/world.cpp index cea84be..a889e34 100644 --- a/world.cpp +++ b/world.cpp @@ -198,6 +198,12 @@ void World::loadSigns(const QSharedPointer &handle, int) { void World::loadNPCs(const QSharedPointer &handle, int version) { npcs.clear(); emit status("Loading NPCs..."); + if (version >= 268) { + int num = handle->r32(); + for (int i = 0; i < num; i++) { + shimmered[handle->r32()] = true; + } + } while (handle->r8()) { NPC npc; npc.head = 0; @@ -244,7 +250,7 @@ void World::loadNPCs(const QSharedPointer &handle, int version) { npc.sprite = theNPC->id; } } - npc.name = "!!"; + npc.name = ""; npc.x = handle->rf(); npc.y = handle->rf(); npc.homeless = true; diff --git a/world.h b/world.h index 5201e9c..1ac66ea 100644 --- a/world.h +++ b/world.h @@ -107,6 +107,7 @@ class World : public QObject, public QRunnable { QList chests; QList signs; QList npcs; + QMap shimmered; QList entities; QMap kills; QList seen;