DETECT_OBJECTS vs SENSE_OBJECTS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eastwind
    Apprentice
    • Dec 2019
    • 79

    DETECT_OBJECTS vs SENSE_OBJECTS

    The effect handlers for these two effects look identical to me. I could only find one reference to EF_DETECT_OBJECTS, and that's in wiz-debug.c, so it could easily be changed to EF_SENSE_OBJECTS and EF_DETECT_OBJECTS and its handler eliminated.
  • Pete Mack
    Prophet
    • Apr 2007
    • 6883

    #2
    They are utterly different. The rogue spell detects objects, as does the activation of Erilil. Detect objects determines the type of object (but not any enchantments), just like !Enlightenment. Sense object just gives *

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9637

      #3
      The difference is between square_sense_pile() and square_know_pile(). And DETECT_OBJECTS and SENSE_OBJECTS are both used in the datafiles - object.txt, class.txt, etc.
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • eastwind
        Apprentice
        • Dec 2019
        • 79

        #4
        Originally posted by Nick
        The difference is between square_sense_pile() and square_know_pile(). And DETECT_OBJECTS and SENSE_OBJECTS are both used in the datafiles - object.txt, class.txt, etc.
        Ah, didn't notice that. I don't have a diff program that can compare two places in the same file with each other, and was just eyeballing it.

        Comment

        • Pete Mack
          Prophet
          • Apr 2007
          • 6883

          #5
          All this said, it is a an example just crying for the visitor pattern. I agree having two (actually more!) subroutines that differ only by a single call is at the very least a style error.

          Comment

          • EpicMan
            Swordsman
            • Dec 2009
            • 455

            #6
            Originally posted by eastwind
            Ah, didn't notice that. I don't have a diff program that can compare two places in the same file with each other, and was just eyeballing it.
            Notepad++ has a compare plugin that works pretty well for that if you're on Windows or Linux.

            Comment

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