ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/anim.C
(Generate patch)

Comparing deliantra/server/common/anim.C (file contents):
Revision 1.30 by root, Tue May 6 16:55:25 2008 UTC vs.
Revision 1.31 by root, Thu Sep 17 01:57:31 2009 UTC

128 * Note in old the is_turning, it was set so that the animation for a monster 128 * Note in old the is_turning, it was set so that the animation for a monster
129 * was always towards the enemy - now it is whatever direction the monster 129 * was always towards the enemy - now it is whatever direction the monster
130 * is facing. 130 * is facing.
131 */ 131 */
132 132
133 if (dir > 0)
133 if (NUM_FACINGS (op) == 2) 134 switch (NUM_FACINGS (op))
134 { 135 {
135 if (dir < 5) 136 case 2: base_state = ((dir - 1) / (8 / 2)) * (NUM_ANIMATIONS (op) / 2); break;
137 case 4: base_state = ((dir - 1) / (8 / 4)) * (NUM_ANIMATIONS (op) / 4); break;
138 case 8: base_state = ((dir - 1) / (8 / 8)) * (NUM_ANIMATIONS (op) / 8); break;
139 }
140 else
136 base_state = 0; 141 base_state = 0;
137 else
138 base_state = NUM_ANIMATIONS (op) / 2;
139 }
140 else if (NUM_FACINGS (op) == 4)
141 {
142 if (dir == 0)
143 base_state = 0;
144 else
145 base_state = ((dir - 1) / 2) * (NUM_ANIMATIONS (op) / 4);
146 }
147 else if (NUM_FACINGS (op) == 8)
148 {
149 if (dir == 0)
150 base_state = 0;
151 else
152 base_state = (dir - 1) * (NUM_ANIMATIONS (op) / 8);
153 }
154 142
155 /* If beyond drawable states, reset */ 143 /* If beyond drawable states, reset */
156 if (op->state >= max_state) 144 if (op->state >= max_state)
157 op->state = 0; 145 op->state = 0;
158 146

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines