Skip to content

Commit

Permalink
SFX.ABSOLUTE => SFX.GLOBAL, fix changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
ashdnazg committed Feb 20, 2019
1 parent 0193643 commit 4ed5ddc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions doc/changelog.txt
Expand Up @@ -117,9 +117,9 @@ Lua:
- Added VFS.GetArchiveContainingFile(string vfsFilePath) -> string archiveName
- add a 6th return value (feature->reclaimTime) to GetFeatureResources.
- Allow spawning of any CEG from any LUS:
EmitSFX("cegTag") param will emit the CEG with tag="cegTag"
EmitSFX(SFX.ABSOLUTE & cegID) will emit the CEG with id=cegID
Added Spring.GetCEGID("cegTag") to return CEG id from tag
EmitSFX(p, "cegTag") param will emit the CEG with tag="cegTag"
EmitSFX(p, SFX.GLOBAL & cegID) will emit the CEG with id=cegID
Added Spring.GetCEGID("cegTag") to get CEG id from tag


AI:
Expand Down
2 changes: 1 addition & 1 deletion rts/Lua/LuaConstCOB.cpp
Expand Up @@ -142,7 +142,7 @@ bool LuaConstSFX::PushEntries(lua_State* L)
LuaPushNamedNumber(L, "CEG", SFX_CEG);
LuaPushNamedNumber(L, "FIRE_WEAPON", SFX_FIRE_WEAPON);
LuaPushNamedNumber(L, "DETONATE_WEAPON", SFX_DETONATE_WEAPON);
LuaPushNamedNumber(L, "ABSOLUTE", SFX_ABSOLUTE);
LuaPushNamedNumber(L, "GLOBAL", SFX_GLOBAL);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion rts/Sim/Units/Scripts/CobDefines.h
Expand Up @@ -18,7 +18,7 @@
#define SFX_CEG 1024
#define SFX_FIRE_WEAPON 2048
#define SFX_DETONATE_WEAPON 4096
#define SFX_ABSOLUTE 16384
#define SFX_GLOBAL 16384


// Indices for set/get value
Expand Down
2 changes: 1 addition & 1 deletion rts/Sim/Units/Scripts/LuaUnitScript.cpp
Expand Up @@ -1200,7 +1200,7 @@ int CLuaUnitScript::EmitSfx(lua_State* L)
int type = CExplosionGeneratorHandler::EXPGEN_ID_INVALID;

if (lua_isstring(L, 2)) {
type = explGenHandler.LoadGeneratorID(std::string(CEG_PREFIX_STRING) + lua_tostring(L, 2)) & SFX_ABSOLUTE;
type = explGenHandler.LoadGeneratorID(std::string(CEG_PREFIX_STRING) + lua_tostring(L, 2)) & SFX_GLOBAL;
} else {
type = luaL_checkint(L, 2);
}
Expand Down
4 changes: 2 additions & 2 deletions rts/Sim/Units/Scripts/UnitScript.cpp
Expand Up @@ -551,10 +551,10 @@ bool CUnitScript::EmitAbsSFX(int sfxType, const float3& absPos, const float3& ab
} break;

default: {
if ((sfxType & SFX_ABSOLUTE) != 0) {
if ((sfxType & SFX_GLOBAL) != 0) {
// emit defined explosion-generator (can only be custom, not standard)
// index is made valid by callee, an ID of -1 means CEG failed to load
explGenHandler.GenExplosion(sfxType - SFX_ABSOLUTE, absPos, absDir, unit->cegDamage, 1.0f, 0.0f, unit, nullptr);
explGenHandler.GenExplosion(sfxType - SFX_GLOBAL, absPos, absDir, unit->cegDamage, 1.0f, 0.0f, unit, nullptr);
return true;
}
if ((sfxType & SFX_CEG) != 0) {
Expand Down

0 comments on commit 4ed5ddc

Please sign in to comment.