hedgewars/CCHandlers.inc
changeset 83 207c85fbef51
parent 81 d74e0e914b50
child 95 1ef5e2c41115
--- a/hedgewars/CCHandlers.inc	Sun Jul 23 21:22:44 2006 +0000
+++ b/hedgewars/CCHandlers.inc	Mon Jul 24 14:03:51 2006 +0000
@@ -67,7 +67,8 @@
 if s[1]='"' then Delete(s, 1, 1);
 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
 if id = 'team' then CurrentTeam.TeamName:= s
-else if (id[1]='h')and(id[2]='h')and(id[3]>='0')and(id[3]<='7') then
+else if (id[1] = 'h') and (id[2] = 'h')
+     and (id[3] >= '0') and (id[3] <= chr(ord('0')+cMaxHHIndex)) then
    CurrentTeam.Hedgehogs[byte(id[3])-48].Name:= s
 else OutError(errmsgUnknownVariable + ' "' + id + '"')
 end;