Skip to content

Commit

Permalink
ScriptedNPC: Add workaround for broken ratman backflip in intro
Browse files Browse the repository at this point in the history
Fixes: issue #93
  • Loading branch information
dscharrer committed Jan 14, 2022
1 parent daa7773 commit 0313c51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/game/magic/Spell.h
Expand Up @@ -119,7 +119,8 @@ enum SpellcastFlag {
SPELLCAST_FLAG_NOCHECKCANCAST = 1 << 5,
SPELLCAST_FLAG_NOSOUND = 1 << 6,
SPELLCAST_FLAG_RESTORE = 1 << 7,
SPELLCAST_FLAG_ORPHAN = 1 << 8
SPELLCAST_FLAG_ORPHAN = 1 << 8,
SPELLCAST_FLAG_NODAMAGE = 1 << 9,
};
DECLARE_FLAGS(SpellcastFlag, SpellcastFlags)
DECLARE_FLAGS_OPERATORS(SpellcastFlags)
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/effects/Lightning.cpp
Expand Up @@ -339,7 +339,7 @@ void CLightning::Render()
a += ePos;
}

if(i % 4 == 0) {
if(i % 4 == 0 && !(m_spell->m_flags & SPELLCAST_FLAG_NODAMAGE)) {
Sphere sphere;
sphere.origin = a;
sphere.radius = std::min(node.size, 50.f);
Expand Down
5 changes: 5 additions & 0 deletions src/script/ScriptedNPC.cpp
Expand Up @@ -249,6 +249,11 @@ class SpellcastCommand : public Command {
spflags |= SPELLCAST_FLAG_NOCHECKCANCAST;
}

if(spellid == SPELL_LIGHTNING_STRIKE && context.getEntity()->idString() == "intro_draw_0001") {
// TODO(patch-scripts) Workaround for http://arx.vg/93
spflags |= SPELLCAST_FLAG_NODAMAGE;
}

DebugScript(' ' << spellname << ' ' << level << ' ' << target << ' ' << spflags << ' '
<< std::chrono::milliseconds(duration).count());

Expand Down

0 comments on commit 0313c51

Please sign in to comment.