[crossfire] [Crossfire-cvs] SF.net SVN: crossfire:[20646] server/trunk/server/player.c

Nicolas Weeger nicolas.weeger at laposte.net
Fri Jan 4 13:42:56 CST 2019


Hello.


That change will break strict ANSI C conformance, as you can't declare 
variables except at the start of a block. Here "turn" is declared only when 
assigned.


I'm fine with that change, of course, but then we should clearly state that 
ANSI C is no longer relevant :)



Best regards


Nicolas


Le samedi 29 décembre 2018 05:42:49, Crossfire CVS repository messages. via 
Crossfire-cvs a écrit :
> Revision: 20646
>           http://sourceforge.net/p/crossfire/code/20646
> Author:   partmedia
> Date:     2018-12-29 04:42:48 +0000 (Sat, 29 Dec 2018)
> Log Message:
> -----------
> Clean up
> 
> Modified Paths:
> --------------
>     server/trunk/server/player.c
> 
> Modified: server/trunk/server/player.c
> ===================================================================
> --- server/trunk/server/player.c	2018-12-29 04:42:41 UTC (rev 20645)
> +++ server/trunk/server/player.c	2018-12-29 04:42:48 UTC (rev 20646)
> @@ -3007,7 +3007,8 @@
>  }
> 
>  /**
> - * Player gave us a direction, check whether to move or fire.
> + * Move player in the given direction. Can be called by a client through a
> + * movement command, or by the server for some other reasons.
>   *
>   * @param op
>   * player.
> @@ -3017,8 +3018,7 @@
>   * 0.
>   */
>  int move_player(object *op, int dir) {
> -    int pick;
> -    object *transport = op->contr->transport;
> +    object *transport = op->contr->transport; //< Transport player is in
> 
>      if (!transport && (op->map == NULL || op->map->in_memory !=
> MAP_IN_MEMORY)) return 0;
> @@ -3029,7 +3029,6 @@
>          return 0;
>      }
> 
> -    /* peterm:  added following line */
>      if (QUERY_FLAG(op, FLAG_CONFUSED) && dir)
>          dir = get_randomized_dir(dir);
> 
> @@ -3036,8 +3035,6 @@
>      op->facing = dir;
> 
>      if (transport) {
> -        int turn;
> -
>          /* transport->contr is set up for the person in charge of the
> boat. * if that isn't this person, he can't steer it, etc
>           */
> @@ -3044,7 +3041,7 @@
>          if (transport->contr != op->contr)
>              return 0;
> 
> -        /* Transport can't move.  But update dir so it at least
> +        /* Transport is out of movement.  But update dir so it at least
>           * will point in the same direction if player is running.
>           */
>          if (transport->speed_left < 0.0) {
> @@ -3057,7 +3054,7 @@
>          if (op->speed_left < 0.0)
>              op->speed_left = -0.01;
> 
> -        turn = turn_transport(transport, op, dir);
> +        int turn = turn_transport(transport, op, dir);
>          if (turn != 0)
>              return 0;
>      } else {
> @@ -3076,7 +3073,7 @@
>      } else
>          move_player_attack(op, dir);
> 
> -    pick = check_pick(op);
> +    int pick = check_pick(op);
> 
> 
>      /* Add special check for newcs players and fire on - this way, the
> 
> This was sent by the SourceForge.net collaborative development platform,
> the world's largest Open Source development site.
> 
> 
> 
> _______________________________________________
> Crossfire-cvs mailing list
> Crossfire-cvs at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/crossfire-cvs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20190104/fabfcf40/attachment.pgp>


More information about the crossfire mailing list