From 439d0375604873ecc7ba38d0d88197c035ffe833 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Fri, 19 Oct 2018 12:08:36 +0800 Subject: check_news --- csrc/news.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/csrc/news.c b/csrc/news.c index c968605..816ddea 100644 --- a/csrc/news.c +++ b/csrc/news.c @@ -1,4 +1,112 @@ #include "mkf/mkf.h" +#include "land.h" + +int check_news(int v) +{ + edi = 1; + esi = 0; + + switch (v) { + case 0: + case 1: + if (dw_496b30 == 0) + return 0; + else + return 1; + case 2: + case 3: + if (dw_496b60 == 0) + return 0; + else + return 1; + case 4: + case 5: + case 15: + for (int i = 1; i <= dw_498e98; i++) { + if (hlands[i].level != 0) + return 1; + } + for (int i = 1; i <= dw_498e8c; i++) { + if (blands[i].level != 0) + return 1; + } + return 0; + case 7: + for (int i = 1; i <= dw_498e98; i++) { + if (hlands[i].owner == 0) + return 1; + } + for (int i = 1; i <= dw_498e8c; i++) { + if (blands[i].owner == 0) + return 1; + } + return 0; + case 8: + case 9: + case 12: + for (int i = 1; i <= dw_498e98; i++) { + if (hlands[i].owner != 0) + return 1; + } + for (int i = 1; i <= dw_498e8c; i++) { + if (blands[i].owner != 0) + return 1; + } + return 0; + case 10: + case 13: + for (int i = 0; i < nplayers; i++) { + for (int j = 0; j < 12; j++) { + if (players[i].who_plays == 0) + continue; + if (player_stocks[i * 12 + j].amount != 0) + return 1; + } + } + return 0; + case 16: + for (int i = 0; i < nplayers; i++) { + if (players[i].who_plays == 0) + continue; + if (players[i].traffic_method == 0) + return 1; + } + return 0; + case 17: + for (int i = 0; i < nplayers; i++) { + if (players[i].who_plays == 0) + continue; + if (players[i].traffic_method != 0) + return 1; + } + return 0; + case 28: + for (int i = 0; i < 12; i++) { + if (byte [i * 36 + 0x496986]) != 0 + return 1; + } + return 0; + case 29: + for (int i = 1; i <= dw_498e90; i++) { + eax = dw_498e7c + i * 0x34; + dl = byte [eax + 0x18]; + if (dl != 0) { + eax = dl - 1; + if (fcn.0040d73f(eax) == 1) + return 1; + } + } + return 0; + case 35: + for (int i = 1; i <= dw_498e90; i++) { + if (dword [dw_498e7c + i * 0x34 + 0x28] > 10000) + return 1; + } + return 0; + default: + return 1; + } +} void news_events(void) { -- cgit v1.2.3