mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 20:11:44 +00:00
fix a temp use error in self.enemy.velocity += vecfunc();
divVerent has full credit for this. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4004 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6bd53e82a3
commit
8e77971422
1 changed files with 11 additions and 0 deletions
|
@ -1428,6 +1428,13 @@ static void QCC_LockTemp(QCC_def_t *d)
|
|||
if (d->temp && d->temp->used)
|
||||
d->temp->scope = pr_scope;
|
||||
}
|
||||
static void QCC_ForceLockTempForOffset(int ofs)
|
||||
{
|
||||
temp_t *t;
|
||||
for (t = functemps; t; t = t->next)
|
||||
if(t->ofs == ofs /* && t->used */)
|
||||
t->scope = pr_scope;
|
||||
}
|
||||
|
||||
static void QCC_RemapLockedTemp(temp_t *t, int firststatement, int laststatement)
|
||||
{
|
||||
|
@ -2391,7 +2398,11 @@ QCC_def_t *QCC_PR_Statement (QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t *var_
|
|||
{
|
||||
/*it came from an OP_ADDRESS - st says the instruction*/
|
||||
if (need_lock)
|
||||
{
|
||||
QCC_ForceLockTempForOffset(statements[st].a);
|
||||
QCC_ForceLockTempForOffset(statements[st].b);
|
||||
QCC_LockTemp(var_c); /*that temp needs to be preserved over calls*/
|
||||
}
|
||||
|
||||
/*generate new OP_ADDRESS instruction - FIXME: the arguments may have changed since the original instruction*/
|
||||
statement_linenums[statement-statements] = statement_linenums[st];
|
||||
|
|
Loading…
Reference in a new issue