[3.3] Earthquake

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2986

    [3.3] Earthquake

    Fixing #1383 introduced a small bug:

    Code:
    					/* If the quake finished the monster off, show message */
    					if (m_ptr->hp < damage && m_ptr->hp >= 0)
    						msg("%^s is embedded in the rock!", m_name);
    					
    					/* Apply damage directly */
    					m_ptr->hp -= damage;
    
    					/* Delete (not kill) "dead" monsters */
    					if (m_ptr->hp < damage)
    					{
    						/* Delete the monster */
    						delete_monster(yy, xx);
    
    						/* No longer safe */
    						sn = 0;
    					}
    Damage is already applied when checking for death... so monsters with more HPs than the damage value and less than double the damage value will be deleted, when they should not.
    PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #2
    So this should all be one if block, right? If (hp < dam && hp > 0) then do all of

    msg("embedded in rock");
    hp -= damage;
    delete_monster();
    sn = 0;

    ... ?
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

    Comment

    • Timo Pietilä
      Prophet
      • Apr 2007
      • 4096

      #3
      Originally posted by Magnate
      So this should all be one if block, right? If (hp < dam && hp > 0) then do all of

      msg("embedded in rock");
      hp -= damage;
      delete_monster();
      sn = 0;

      ... ?
      Maybe "else hp-=damage"?, because if it survives the checks, it has enough HP to live.

      Or maybe this

      Code:
      /* Delete (not kill) "dead" monsters */
      					if (m_ptr->hp < damage)
      should be

      Code:
      /* Delete (not kill) "dead" monsters */
      					if (m_ptr->hp < 0)

      Comment

      • PowerWyrm
        Prophet
        • Apr 2008
        • 2986

        #4
        Exactly: replace if (m_ptr->hp < damage) by if (m_ptr->hp < 0)
        PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

        Comment

        • Magnate
          Angband Devteam member
          • May 2007
          • 5110

          #5
          Originally posted by PowerWyrm
          Exactly: replace if (m_ptr->hp < damage) by if (m_ptr->hp < 0)
          Fixed in staging - thanks.
          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎