From 05861ca745dcc50072510096a246e868ddce2f89 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 7 Jul 2012 21:38:03 +0000 Subject: [PATCH] Treat robot joints as const --- main/ai2.c | 4 ++-- main/robot.c | 2 +- main/robot.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/ai2.c b/main/ai2.c index 297b43b62..74ef05c87 100644 --- a/main/ai2.c +++ b/main/ai2.c @@ -525,7 +525,7 @@ int player_is_visible_from_object(object *objp, vms_vector *pos, fix field_of_vi int do_silly_animation(object *objp) { int objnum = objp-Objects; - jointpos *jp_list; + const jointpos *jp_list; int robot_type, gun_num, robot_state, num_joint_positions; polyobj_info *pobj_info = &objp->rtype.pobj_info; ai_static *aip = &objp->ctype.ai_info; @@ -560,7 +560,7 @@ int do_silly_animation(object *objp) for (joint=0; jointanim_angles[jointnum]; if (jointnum >= Polygon_models[objp->rtype.pobj_info.model_num].n_models) { diff --git a/main/robot.c b/main/robot.c index 701cdb96a..0d421b049 100644 --- a/main/robot.c +++ b/main/robot.c @@ -131,7 +131,7 @@ void calc_gun_point(vms_vector *gun_point,object *obj,int gun_num) //fills in ptr to list of joints, and returns the number of joints in list //takes the robot type (object id), gun number, and desired state -int robot_get_anim_state(jointpos **jp_list_ptr,int robot_type,int gun_num,int state) +int robot_get_anim_state(const jointpos **jp_list_ptr,int robot_type,int gun_num,int state) { Assert(gun_num <= Robot_info[robot_type].n_guns); diff --git a/main/robot.h b/main/robot.h index 7bc6c41ee..8f82af170 100644 --- a/main/robot.h +++ b/main/robot.h @@ -173,7 +173,7 @@ void calc_gun_point(vms_vector *gun_point,struct object *obj,int gun_num); // On exit: // Returns number of joints in list. // jp_list_ptr is stuffed with a pointer to a static array of joint positions. This pointer is valid forever. -extern int robot_get_anim_state(jointpos **jp_list_ptr,int robot_type,int gun_num,int state); +extern int robot_get_anim_state(const jointpos **jp_list_ptr,int robot_type,int gun_num,int state); /* * reads n robot_info structs from a PHYSFS_file