| 3228 | } |
| 3229 | |
| 3230 | void OperateBookcase(Object &bookcase, bool sendmsg, bool sendLootMsg) |
| 3231 | { |
| 3232 | if (bookcase._oSelFlag == 0) { |
| 3233 | return; |
| 3234 | } |
| 3235 | |
| 3236 | PlaySfxLoc(IS_ISCROL, bookcase.position); |
| 3237 | bookcase._oSelFlag = 0; |
| 3238 | bookcase._oAnimFrame -= 2; |
| 3239 | SetRndSeed(bookcase._oRndSeed); |
| 3240 | CreateTypeItem(bookcase.position, false, ItemType::Misc, IMISC_BOOK, sendLootMsg, false); |
| 3241 | |
| 3242 | if (Quests[Q_ZHAR].IsAvailable()) { |
| 3243 | auto &zhar = Monsters[MAX_PLRS]; |
| 3244 | if (zhar.mode == MonsterMode::Stand // prevents playing the "angry" message for the second time if zhar got aggroed by losing vision and talking again |
| 3245 | && zhar.uniqueType == UniqueMonsterType::Zhar |
| 3246 | && zhar.activeForTicks == UINT8_MAX |
| 3247 | && zhar.hitPoints > 0) { |
| 3248 | zhar.talkMsg = TEXT_ZHAR2; |
| 3249 | M_StartStand(zhar, zhar.direction); // BUGFIX: first parameter in call to M_StartStand should be MAX_PLRS, not 0. (fixed) |
| 3250 | zhar.goal = MonsterGoal::Attack; |
| 3251 | if (sendmsg) |
| 3252 | zhar.mode = MonsterMode::Talk; |
| 3253 | } |
| 3254 | } |
| 3255 | if (sendmsg) |
| 3256 | NetSendCmdLoc(MyPlayerId, false, CMD_OPERATEOBJ, bookcase.position); |
| 3257 | } |
| 3258 | |
| 3259 | void OperateDecapitatedBody(Object &corpse, bool sendmsg, bool sendLootMsg) |
| 3260 | { |
no test coverage detected