Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old December 30, 2019, 23:30   #1
eastwind
Apprentice
 
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
eastwind is on a distinguished road
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.
eastwind is offline   Reply With Quote
Old December 31, 2019, 00:46   #2
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,601
Donated: $40
Pete Mack is on a distinguished road
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 *
Pete Mack is offline   Reply With Quote
Old December 31, 2019, 00:49   #3
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,984
Donated: $60
Nick will become famous soon enough
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.
Nick is online now   Reply With Quote
Old December 31, 2019, 02:20   #4
eastwind
Apprentice
 
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
eastwind is on a distinguished road
Quote:
Originally Posted by Nick View Post
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.
eastwind is offline   Reply With Quote
Old December 31, 2019, 04:10   #5
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,601
Donated: $40
Pete Mack is on a distinguished road
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.
Pete Mack is offline   Reply With Quote
Old December 31, 2019, 16:59   #6
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 385
EpicMan is on a distinguished road
Quote:
Originally Posted by eastwind View Post
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.
EpicMan is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.