[Crossfire-wiki] [Crossfire DokuWiki] page added: dev_todo:make_slaying_consistent

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Sun Sep 17 01:22:16 CDT 2006


A page in your DokuWiki was added or changed. Here are the details:



Date        : 2006/09/17 01:22

User        : mwedel

Edit Summary: created



Slaying is sloppy in that it uses strstr.  This, an item that has 'slaying
 giant' (like holyword of mostrai) will kill ants.  strstr matching was mo
st likely added to support comma seperated slaying lists (slaying demon,un
dead). However, the code should really insist on exact matching, and if ne
cessarybreak apart the comma seperated list.  Probably best to make someth
ing like a 'does_slay()' function which can be used all over the place (co
nsistent behaviour is a good thing).  If performance for this becomes an i
ssue, making a slaying a set of pointers could be done (char **slaying), a
nd it gets filled in at load time, and at save time, gets filled in the op
posite direction. However, from a simple basis, a check in does_slay() can
 be done to see if slaying does contain a comma, and if not, just do simpl
e strcmp, and only if it does does extra work need to be done. MSW 2003-03
-28



IP-Address  : 209.204.178.229

Old Revision: none

New Revision: http://wiki.metalforge.net/doku.php/dev_todo:make_slaying_co
nsistent



-- 

This mail was generated by DokuWiki at

http://wiki.metalforge.net/





More information about the crossfire-wiki mailing list