Skip to content

Commit

Permalink
fixed crashing bug, collect npc shimmer data but dont use it
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkite committed Jan 24, 2023
1 parent 7e1f500 commit 39d3152
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Terrafirma</Name>
<Version>3.1.10</Version>
<Version>3.1.11</Version>
<Title>Terrafirma Installer</Title>
<Publisher>Sean Kasun</Publisher>
<StartMenuDir>Terrafirma</StartMenuDir>
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
terrafirma (3.1.11) focal; urgency=medium

* Fixed crash in 1.4.4.9

-- Sean Kasun <[email protected]> Mon, 23 Jan 2023 19:44:05 -0700

terrafirma (3.1.10) focal; urgency=medium

* Updated for 1.4.4.9
Expand Down
2 changes: 1 addition & 1 deletion glmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions packages/com.seancode.terrafirma/meta/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Package>
<DisplayName>Terrafirma</DisplayName>
<Description>Terraria mapping software</Description>
<Version>3.1.10</Version>
<ReleaseDate>2023-01-22</ReleaseDate>
<Version>3.1.11</Version>
<ReleaseDate>2023-01-23</ReleaseDate>
<Default>true</Default>
<Required>true</Required>
<Script>installscript.qs</Script>
Expand Down
2 changes: 1 addition & 1 deletion res/header.json
Original file line number Diff line number Diff line change
@@ -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"}]
[{"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"}]
8 changes: 7 additions & 1 deletion world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ void World::loadSigns(const QSharedPointer<Handle> &handle, int) {
void World::loadNPCs(const QSharedPointer<Handle> &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;
Expand Down Expand Up @@ -244,7 +250,7 @@ void World::loadNPCs(const QSharedPointer<Handle> &handle, int version) {
npc.sprite = theNPC->id;
}
}
npc.name = "!!";
npc.name = "";
npc.x = handle->rf();
npc.y = handle->rf();
npc.homeless = true;
Expand Down
1 change: 1 addition & 0 deletions world.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class World : public QObject, public QRunnable {
QList<Chest> chests;
QList<Sign> signs;
QList<NPC> npcs;
QMap<qint32, bool> shimmered;
QList<Entity> entities;
QMap<QString, qint32> kills;
QList<QString> seen;
Expand Down

0 comments on commit 39d3152

Please sign in to comment.