MCPcopy Create free account
hub / github.com/diasurgical/devilution / S_TalkEnter

Function S_TalkEnter

Source/stores.cpp:2548–2586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2546}
2547
2548void S_TalkEnter()
2549{
2550 int i, tq, sn, la;
2551
2552 if (stextsel == 22) {
2553 StartStore(stextshold);
2554 stextsel = stextlhold;
2555 return;
2556 }
2557
2558 sn = 0;
2559 for (i = 0; i < MAXQUESTS; i++) {
2560 if (quests[i]._qactive == 2 && ((DWORD *)&Qtalklist[talker])[i] != -1 && quests[i]._qlog)
2561 sn++;
2562 }
2563 if (sn > 6) {
2564 sn = 14 - (sn >> 1);
2565 la = 1;
2566 } else {
2567 sn = 15 - sn;
2568 la = 2;
2569 }
2570
2571 if (stextsel == sn - 2) {
2572 SetRndSeed(towner[talker]._tSeed);
2573 tq = gossipstart + random_(0, gossipend - gossipstart + 1);
2574 InitQTextMsg(tq);
2575 return;
2576 }
2577
2578 for (i = 0; i < MAXQUESTS; i++) {
2579 if (quests[i]._qactive == 2 && ((DWORD *)&Qtalklist[talker])[i] != -1 && quests[i]._qlog) {
2580 if (sn == stextsel) {
2581 InitQTextMsg(((DWORD *)&Qtalklist[talker])[i]);
2582 }
2583 sn += la;
2584 }
2585 }
2586}
2587
2588void S_TavernEnter()
2589{

Callers 1

STextEnterFunction · 0.85

Calls 4

StartStoreFunction · 0.85
SetRndSeedFunction · 0.85
random_Function · 0.85
InitQTextMsgFunction · 0.85

Tested by

no test coverage detected