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

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Tue May 29 15:26:38 CDT 2007


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

Date        : 2007/05/29 15:26
User        : ryo
Edit Summary: reply

@@ -1,4 +1,6 @@
  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 most likely added to support comma seperated slaying lists (slaying demon,undead). However, the code should really insist on exact matching, and if necessarybreak apart the comma seperated list.  Probably best to make something like a 'does_slay()' function which can be used all over the place (consistent behaviour is a good thing).  If performance for this becomes an issue, making a slaying a set of pointers could be done (char **slaying), and it gets filled in at load time, and at save time, gets filled in the opposite 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 simple strcmp, and only if it does does extra work need to be done. MSW 2003-03-28
  
  (Is this actually [still] true?  It looks like the code still uses strstr, but goes off of "race" rather than "name" - so "slaying giant" shouldn't affect ants [race: insect].  So long as the "race" names used throughout the arches are appropriate and carefully chosen this should work fine...and allow a hypothetical "firehose" spell having "slaying: fire" to affect any race with "fire" in it e.g. "fire elemental"- and "race" ends up being usable as glorified keywords?  I think?)
  Epicanis 20070527
+ 
+ > Actually it is still the case. hit_player_attacktype (attack.c:1229) still compares to the name of the archetype, thus there can be issues. Also, it would be nice to have one central test location, so for instance multiple slaying can be implemented.  --- //[[nicolas.weeger at laposte.net|Ryo Saeba]] 2007/05/29 15:22//


IP-Address  : 82.236.87.204
Old Revision: http://wiki.metalforge.net/doku.php/dev_todo:make_slaying_consistent?rev=1180291388
New Revision: http://wiki.metalforge.net/doku.php/dev_todo:make_slaying_consistent

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list