| 1236 | |
| 1237 | |
| 1238 | void cClientHandle::HandleAnimation(char a_Animation) |
| 1239 | { |
| 1240 | if (cPluginManager::Get()->CallHookPlayerAnimation(*m_Player, a_Animation)) |
| 1241 | { |
| 1242 | // Plugin disagrees, bail out |
| 1243 | return; |
| 1244 | } |
| 1245 | |
| 1246 | // Because the animation ID sent to servers by clients are different to those sent back, we need this |
| 1247 | switch (a_Animation) |
| 1248 | { |
| 1249 | case 0: // No animation - wiki.vg doesn't say that client has something specific for it, so I suppose it will just become -1 |
| 1250 | case 1: |
| 1251 | case 2: |
| 1252 | case 3: |
| 1253 | { |
| 1254 | a_Animation--; // Offset by -1 |
| 1255 | break; |
| 1256 | } |
| 1257 | case 5: |
| 1258 | case 6: |
| 1259 | case 7: |
| 1260 | { |
| 1261 | a_Animation -= 2; // Offset by -2 |
| 1262 | break; |
| 1263 | } |
| 1264 | default: // Anything else is the same |
| 1265 | break; |
| 1266 | } |
| 1267 | |
| 1268 | m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, a_Animation, this); |
| 1269 | } |
| 1270 | |
| 1271 | |
| 1272 |
no test coverage detected