[Fixed] SetActorProperty Friendliness doesn't update monster count

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

SetActorProperty Friendliness doesn't update monster count

Postby Kate » Mon Jul 19, 2010 2:39 pm

Self-explanatory. As of the latest revision, the code looks like this:
Code: Select allExpand view
    case APROP_Friendly:
        if (value)
            actor->flags |= MF_FRIENDLY;
        else
            actor->flags &= ~MF_FRIENDLY;
        break;

When updating the flag however, one needs to remove it from the total monster count so that it doesn't linger and become impossible to get 100% kills if the thing is later removed by thing_remove. A fixed version would look something like this:

Code: Select allExpand view
   case APROP_Friendly:
      if (value)
      {
         if (actor->flags & MF_COUNTKILL) level.total_monsters--;
         actor->flags |= MF_FRIENDLY;
      }
      else
      {
         if (actor->flags & MF_COUNTKILL) level.total_monsters++;
         actor->flags &= ~MF_FRIENDLY;
      }
      break;
User avatar
Kate
... in loving memory ...
 
Joined: 15 Jul 2003

Re: SetActorProperty Friendliness doesn't update monster cou

Postby Graf Zahl » Tue Aug 10, 2010 9:12 am

No, it won't. That code would mess up as easily as the current version, just differently.

Fixed anyway.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests