| 409 | } |
| 410 | |
| 411 | S32 zEntDestructObjEventCB(xBase* from, xBase* to, U32 toEvent, const F32* toParam, xBase* toParamWidget) |
| 412 | { |
| 413 | zEntDestructObj* s = (zEntDestructObj*)to; |
| 414 | |
| 415 | switch (toEvent) { |
| 416 | case eEventVisible: |
| 417 | case eEventFastVisible: |
| 418 | xEntShow(s); |
| 419 | if (toParam && (S32)(0.5f + toParam[0]) == 77) { |
| 420 | zFXPopOn(*s, toParam[1], toParam[2]); |
| 421 | } |
| 422 | break; |
| 423 | case eEventInvisible: |
| 424 | case eEventFastInvisible: |
| 425 | xEntHide(s); |
| 426 | if (toParam && (S32)(0.5f + toParam[0]) == 77) { |
| 427 | zFXPopOff(*s, toParam[1], toParam[2]); |
| 428 | } |
| 429 | break; |
| 430 | case eEventCollisionOn: |
| 431 | s->chkby |= (XENT_COLLTYPE_PLYR | XENT_COLLTYPE_NPC); |
| 432 | s->bupdate(s, (xVec3*)&s->model->Mat->pos); |
| 433 | break; |
| 434 | case eEventCollisionOff: |
| 435 | s->chkby &= (U8)~(XENT_COLLTYPE_PLYR | XENT_COLLTYPE_NPC); |
| 436 | break; |
| 437 | case eEventCollision_Visible_On: |
| 438 | s->chkby |= (XENT_COLLTYPE_PLYR | XENT_COLLTYPE_NPC); |
| 439 | xEntShow(s); |
| 440 | s->bupdate(s, (xVec3*)&s->model->Mat->pos); |
| 441 | if (toParam && (S32)(0.5f + toParam[0]) == 77) { |
| 442 | zFXPopOn(*s, toParam[1], toParam[2]); |
| 443 | } |
| 444 | break; |
| 445 | case eEventCollision_Visible_Off: |
| 446 | s->chkby &= (U8)~(XENT_COLLTYPE_PLYR | XENT_COLLTYPE_NPC); |
| 447 | xEntHide(s); |
| 448 | if (toParam && (S32)(0.5f + toParam[0]) == 77) { |
| 449 | zFXPopOff(*s, toParam[1], toParam[2]); |
| 450 | } |
| 451 | break; |
| 452 | case eEventCameraCollideOn: |
| 453 | zCollGeom_CamEnable(s); |
| 454 | break; |
| 455 | case eEventCameraCollideOff: |
| 456 | zCollGeom_CamDisable(s); |
| 457 | break; |
| 458 | case eEventDestroy: |
| 459 | if (s->destroy_model) { |
| 460 | SwapModel(s, s->destroy_model); |
| 461 | } else { |
| 462 | s->chkby &= (U8)~(XENT_COLLTYPE_PLYR | XENT_COLLTYPE_NPC); |
| 463 | xEntHide(s); |
| 464 | } |
| 465 | zEntDestructObj_DestroyFX(s); |
| 466 | s->state = 2; |
| 467 | if (s->shrapnel_destroy && s->shrapnel_destroy->initCB) { |
| 468 | s->shrapnel_destroy->initCB(s->shrapnel_destroy, s->model, NULL, NULL); |
nothing calls this directly
no test coverage detected