MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / ParseNonRandTalk

Method ParseNonRandTalk

src/SB/Game/zNPCTypeVillager.cpp:431–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void zNPCVillager::ParseNonRandTalk()
432{
433 NPCConfig* cfg = this->cfg_npc;
434 cfg->talk_filter_size = 0;
435 F32 non_choices[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
436
437 S32 found = zParamGetFloatList(this->parmdata, this->pdatsize, "NonRandomTalkAnims", 4,
438 non_choices, non_choices);
439
440 for (S32 i = 0; i < 4; i++)
441 {
442 U8 skip = 0;
443 for (S32 j = 0; j < found; j++)
444 {
445 S32 choice_val = (S32)non_choices[j] - 1;
446 if (choice_val == i)
447 {
448 skip = 1;
449 break;
450 }
451 }
452
453 if (!skip)
454 {
455 cfg->talk_filter[cfg->talk_filter_size] = i;
456 cfg->talk_filter_size++;
457 }
458 }
459
460 if (cfg->talk_filter_size == 0)
461 {
462 cfg->talk_filter[0] = 0;
463 cfg->talk_filter_size = 1;
464 }
465}
466
467void zNPCVillager::Process(xScene* xscn, F32 dt)
468{

Callers

nothing calls this directly

Calls 1

zParamGetFloatListFunction · 0.70

Tested by

no test coverage detected