bug fix for trap.txt

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: bug fix for trap.txt
Shock Trooper
Member # 4180
Profile #0
The trap.txt script doesn't work "out of the box" as stated in the opening comments. It never checks to see if the party has a special item to help disarm it.

To fix it, look for the two spots that say:

if (get_highest_skill(15) < get_mechanism_difficulty()) {
print_str_color("The trap goes off!",2);
and change them to:

if ((get_highest_skill(15) < get_mechanism_difficulty()) && (get_memory_cell(1) == 0 ||
(has_special_item(get_memory_cell(1)) == 0))) {
print_str_color("The trap goes off!",2);
Of course, if you never use a special item for disarming a trap, it won't matter. :)

(NB: It's only the if that changed--I included the next line only to help establish context.)

EDIT: Typo... had a misplaced close parenthesis that would have made the trap always disarm, even without the special item. :o

-spyderbytes

[ Sunday, April 11, 2004 12:55: Message edited by: spyderbytes ]

--------------------
-spyderbytes
Posts: 200 | Registered: Wednesday, March 31 2004 08:00