Script Errors and Design Etiquette

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: Script Errors and Design Etiquette
...b10010b...
Member # 869
Profile Homepage #0
In a particular town, I call a relatively large number of town special states, pretty much all of which involve NPC interaction. If the town is hostile, none of these make sense and I don't want them to occur.

Now, the *easiest* way for me to handle this, rather than have each state individually check the crime level, would be to have the START_STATE check the crime level, and if it's enough to make the town hostile, run code that contains an intentional syntax error (thus unloading the town script as soon as it's loaded).

Apart from one unsightly error message when the party commits a crime and every time the town is loaded after that, there should be no other harmful side effects.

Is it bad form to deliberately cause a scripting error to save myself a little work? Should I do it the right way (that is, manually put the check into every state) just to avoid the error message? Are there any problems with unloading the town script that I'm unaware of?

[ Wednesday, January 26, 2005 14:54: Message edited by: Thuryl ]

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
The Establishment
Member # 6
Profile #1
You should always try to prevent errors. Do it the right way.

--------------------
Your flower power is no match for my glower power!
Posts: 3726 | Registered: Tuesday, September 18 2001 07:00
...b10010b...
Member # 869
Profile Homepage #2
You're right, of course. It'll save me work later if I do need to call a state even if the town is hostile, in which case I'll have to rewrite things the right way in any case. I was just throwing around an idea that came to mind, really.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00