From: Alyssa M. <fu...@us...> - 2011-04-19 17:11:30
|
gemrb: Infinity Engine emulator The branch master has been updated via 1029602469fd8c0f39a5daf9bc6ebb26c3c00e5d (commit) Summary of changes: gemrb/core/EffectQueue.cpp | 7 ++++--- gemrb/plugins/EFFImporter/EFFImporter.cpp | 25 +++++++++++++++++-------- 2 files changed, 21 insertions(+), 11 deletions(-) from fe37913c3bf58bcfd98d06b8e41d46ff5f266dbd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=1029602469fd8c0f39a5daf9bc6ebb26c3c00e5d commit 1029602469fd8c0f39a5daf9bc6ebb26c3c00e5d Author: Alyssa Milburn <fu...@fu...> Date: Tue Apr 19 19:03:51 2011 +0200 Save variable effects properly. This fixes EFFImporter to save variable names properly, and stops EffectQueue from sabotaging fx_local_variable. It might still need some work for the earlier games to make sure they save the effects as the right version? This also makes EFFImporter save CasterLevel while I'm futzing with it. diff --git a/gemrb/core/EffectQueue.cpp b/gemrb/core/EffectQueue.cpp index 38cbabe..db14855 100644 --- a/gemrb/core/EffectQueue.cpp +++ b/gemrb/core/EffectQueue.cpp @@ -1765,12 +1765,13 @@ bool EffectQueue::HasDuration(Effect *fx) static EffectRef fx_variable_ref = { "Variable:StoreLocalVariable", -1 }; //returns true if the effect must be saved -//variables are saved differently bool EffectQueue::Persistent(Effect* fx) { - //we save this as variable + // local variable effects self-destruct if they were processed already + // but if they weren't processed, e.g. in a global actor, we must save them + // TODO: do we really need to special-case this? leaving it for now - fuzzie if( fx->Opcode==(ieDword) ResolveEffect(fx_variable_ref)) { - return false; + return true; } switch (fx->TimingMode) { diff --git a/gemrb/plugins/EFFImporter/EFFImporter.cpp b/gemrb/plugins/EFFImporter/EFFImporter.cpp index 5da8be8..d86806e 100644 --- a/gemrb/plugins/EFFImporter/EFFImporter.cpp +++ b/gemrb/plugins/EFFImporter/EFFImporter.cpp @@ -197,23 +197,25 @@ void EFFImporter::PutEffectV2(DataStream *stream, const Effect *fx) { stream->WriteDword( &fx->Duration); stream->WriteWord( &fx->Probability1); stream->WriteWord( &fx->Probability2); - stream->WriteResRef(fx->Resource); + if (fx->IsVariable) { + stream->Write( filling,8 ); + } else { + stream->WriteResRef(fx->Resource); + } stream->WriteDword( &fx->DiceThrown ); stream->WriteDword( &fx->DiceSides ); stream->WriteDword( &fx->SavingThrowType ); stream->WriteDword( &fx->SavingThrowBonus ); - //isvariable - stream->Write( filling,4 ); + stream->WriteWord( &fx->IsVariable ); + stream->Write( filling,2 ); // SaveForHalfDamage stream->WriteDword( &fx->PrimaryType ); - stream->Write( filling,12 ); + stream->Write( filling,12 ); // MinAffectedLevel, MaxAffectedLevel, Resistance stream->WriteDword( &fx->Resistance ); stream->WriteDword( &fx->Parameter3 ); stream->WriteDword( &fx->Parameter4 ); stream->Write( filling,8 ); if (fx->IsVariable) { - stream->Write(fx->Resource+8, 8); - //resource1-4 are used as a continuous memory - stream->Write(((ieByte *) fx->Resource)+16, 8); + stream->Write( filling,16 ); } else { stream->WriteResRef(fx->Resource2); stream->WriteResRef(fx->Resource3); @@ -231,7 +233,14 @@ void EFFImporter::PutEffectV2(DataStream *stream, const Effect *fx) { stream->WriteDword( &fx->Projectile ); tmpDword1 = (ieDword) fx->InventorySlot; stream->WriteDword( &tmpDword1 ); - stream->Write( filling,40 ); //12+32+8 + if (fx->IsVariable) { + //resource1-4 are used as a continuous memory + stream->Write(fx->Resource, 32); + } else { + stream->Write( filling,32 ); + } + stream->WriteDword( &fx->CasterLevel); + stream->Write( filling,4); stream->WriteDword( &fx->SecondaryType ); stream->Write( filling,60 ); } ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |