On Wednesday 06 November 2002 03:55 pm, Josh wrote:
> i know this exact code isnt possible, but is it possible to fool the code
> into thinking gsn_kick is a constant, since it doesnt change?

No...
The compiler really needs to know the value at compile time.  It's not just a 
fancy way of writing if-then-else, it's optimized by putting the integer 
constants in a table related to where to jump in the code.

What you could do if you REALLY want a switch statement is use a field in the 
skill table that is a unique constant... if you haven't gotten rid of the 
slots in skill table, you could use those as the constants.
Then it's simple..

switch(skill_table[sn].slot)
{
  case GSN_KICK_SLOT:
....

--Palrich.


Reply via email to