fixed compiler warnings and wrong for i loops
fixed compiler warnings and wrong for i loops

DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,rbouqueau/mistserver,rbouqueau/mistserver,rbouqueau/mistserver,rbouqueau/mistserver,rbouqueau/mistserver