diff --git a/Source/misdat.cpp b/Source/misdat.cpp index 0303625dd60..edab9e73f94 100644 --- a/Source/misdat.cpp +++ b/Source/misdat.cpp @@ -371,11 +371,11 @@ void LoadMisdat() RecordReader reader { record, filename }; MissileData &item = MissilesData.emplace_back(); reader.advance(); // skip id - reader.read("addFn", item.mAddProc, ParseMissileAddFn); - reader.read("processFn", item.mProc, ParseMissileProcessFn); - reader.read("castSound", item.mlSFX, ParseCastSound); - reader.read("hitSound", item.miSFX, ParseHitSound); - reader.read("graphicId", item.mFileNum, ParseMissileGraphicID); + reader.read("addFn", item.addFn, ParseMissileAddFn); + reader.read("processFn", item.processFn, ParseMissileProcessFn); + reader.read("castSound", item.castSound, ParseCastSound); + reader.read("hitSound", item.hitSound, ParseHitSound); + reader.read("graphic", item.graphic, ParseMissileGraphicID); reader.readEnumList("flags", item.flags, ParseMissileDataFlag); reader.read("movementDistribution", item.movementDistribution, ParseMissileMovementDistribution); } diff --git a/Source/misdat.h b/Source/misdat.h index e8ac7c7f519..17fc2c84359 100644 --- a/Source/misdat.h +++ b/Source/misdat.h @@ -131,18 +131,18 @@ struct MissileData { using AddFn = void (*)(Missile &, AddMissileParameter &); using ProcessFn = void (*)(Missile &); - AddFn mAddProc; - ProcessFn mProc; + AddFn addFn; + ProcessFn processFn; /** * @brief Sound emitted when cast. */ - SfxID mlSFX; + SfxID castSound; /** * @brief Sound emitted on impact. */ - SfxID miSFX; - MissileGraphicID mFileNum; + SfxID hitSound; + MissileGraphicID graphic; MissileDataFlags flags; MissileMovementDistribution movementDistribution; diff --git a/Source/missiles.cpp b/Source/missiles.cpp index aa611ec116b..31d9a17df37 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -471,8 +471,8 @@ void CheckMissileCol(Missile &missile, DamageType damageType, int minDamage, int } const MissileData &missileData = GetMissileData(missile._mitype); - if (missile._mirange == 0 && missileData.miSFX != SfxID::None) - PlaySfxLoc(missileData.miSFX, missile.position.tile); + if (missile._mirange == 0 && missileData.hitSound != SfxID::None) + PlaySfxLoc(missileData.hitSound, missile.position.tile); } bool MoveMissile(Missile &missile, tl::function_ref checkTile, bool ifCheckTileFailsDontMoveToTile = false) @@ -2727,7 +2727,7 @@ Missile *AddMissile(WorldTilePosition src, WorldTilePosition dst, Direction midi missile.position.tile = src; missile.position.start = src; missile._miAnimAdd = 1; - missile._miAnimType = missileData.mFileNum; + missile._miAnimType = missileData.graphic; missile._miDrawFlag = missileData.isDrawn(); missile._mlid = NO_LIGHT; missile.lastCollisionTargetHash = 0; @@ -2745,7 +2745,7 @@ Missile *AddMissile(WorldTilePosition src, WorldTilePosition dst, Direction midi SetMissDir(missile, midir); if (!lSFX) { - lSFX = missileData.mlSFX; + lSFX = missileData.castSound; } if (*lSFX != SfxID::None) { @@ -2753,7 +2753,7 @@ Missile *AddMissile(WorldTilePosition src, WorldTilePosition dst, Direction midi } AddMissileParameter parameter = { dst, midir, parent, false }; - missileData.mAddProc(missile, parameter); + missileData.addFn(missile, parameter); if (parameter.spellFizzled) { return nullptr; } @@ -4155,8 +4155,8 @@ void ProcessMissiles() for (auto &missile : Missiles) { const MissileData &missileData = GetMissileData(missile._mitype); - if (missileData.mProc != nullptr) - missileData.mProc(missile); + if (missileData.processFn != nullptr) + missileData.processFn(missile); if (missile._miAnimFlags == MissileGraphicsFlags::NotAnimated) continue; diff --git a/assets/txtdata/missiles/misdat.tsv b/assets/txtdata/missiles/misdat.tsv index 3f5646ccce9..37ea3e69665 100644 --- a/assets/txtdata/missiles/misdat.tsv +++ b/assets/txtdata/missiles/misdat.tsv @@ -1,4 +1,4 @@ -id addFn processFn castSound hitSound graphicId flags movementDistribution +id addFn processFn castSound hitSound graphic flags movementDistribution Arrow AddArrow ProcessArrow Arrow Physical,Arrow Blockable Firebolt AddFirebolt ProcessGenericProjectile SpellFirebolt SpellFireHit Fireball Fire Blockable Guardian AddGuardian ProcessGuardian SpellGuardian Guardian Physical