Browse Source

fix bip pages not initializing correctly

master
Alison Watson 11 months ago
parent
commit
85d0f86e9d
6 changed files with 19 additions and 14 deletions
  1. +1
    -1
      source/include/p_bip.h
  2. +4
    -4
      source/m_namegen.c
  3. +11
    -6
      source/p_bip.c
  4. +1
    -1
      source/p_cbi.c
  5. +1
    -1
      source/p_gui_bip.c
  6. +1
    -1
      tools/infc.rb

+ 1
- 1
source/include/p_bip.h View File

@@ -76,7 +76,7 @@ struct bip {

/* Extern Objects ---------------------------------------------------------- */

extern struct pageinfo bipinfo[BIP_MAX];
extern struct pageinfo const bipinfo[BIP_MAX];

/* Extern Functions -------------------------------------------------------- */



+ 4
- 4
source/m_namegen.c View File

@@ -19,7 +19,7 @@

/* Static Objects ---------------------------------------------------------- */

static cstr syll[] = {
static cstr const syll[] = {
"ka", "k'", "khi", "kaz", "kr",
"ga", "go", "gor", "got", "gn", "gl",
"sha", "sk", "shu", "shi", "si",
@@ -36,7 +36,7 @@ static cstr syll[] = {
"ver", "xel'", "xe",
};

static cstr lulz[] = {
static cstr const lulz[] = {
"explod",
"fuck",
"help",
@@ -46,7 +46,7 @@ static cstr lulz[] = {
"why",
};

static cstr name[] = {
static cstr const name[] = {
"Alevot",
"Arafonad",
"Araxidak",
@@ -158,7 +158,7 @@ static cstr name[] = {
"Yar'udab",
};

static cstr suff[] = {
static cstr const suff[] = {
"Agent of Damnation",
"Alpha and Omega",
"Betrayer of All",


+ 11
- 6
source/p_bip.c View File

@@ -29,7 +29,7 @@ script static void MailNotify(struct player *p, cstr name) {

ACS_Delay(20);

char remote[64];
char remote[128];
strcpy(remote, LanguageC(LANG "INFO_REMOT_%s", name));

p->logB(1, LC(LANG "LOG_MailRecv"), remote);
@@ -44,7 +44,7 @@ script static void MailNotify(struct player *p, cstr name) {

script static void UnlockPage(struct player *p, struct page *page) {
if(!get_bit(page->flags, _page_available)) {
Dbg_Log(log_bip, "page '%s' not available", page->info->name);
Dbg_Log(log_bip, "ERROR page '%s' not available", page->info->name);
return;
}

@@ -98,7 +98,9 @@ script void P_BIP_PInit(struct player *p) {
for_page() {
page->info = &bipinfo[pagen];
page->flags = 0;
}

for_page() {
bool avail = page->info->pclass & p->pclass;

if(avail) {
@@ -106,10 +108,13 @@ script void P_BIP_PInit(struct player *p) {

p->bip.pagemax++;
p->bip.categorymax[page->info->category]++;
}
}

if(get_bit(dbgflag, dbgf_bip) || page->info->aut) {
UnlockPage(p, page);
}
for_page() {
if(get_bit(page->flags, _page_available) &&
(get_bit(dbgflag, dbgf_bip) || page->info->aut)) {
UnlockPage(p, page);
}
}

@@ -120,7 +125,7 @@ void P_BIP_Unlock(struct player *p, cstr name) {
u32 num = NameToNum(p->discrim, name);

if(num == BIP_MAX) {
Dbg_Log(log_bip, "no page '%s' found", name);
Dbg_Log(log_bip, "ERROR no page '%s' found", name);
return;
}



+ 1
- 1
source/p_cbi.c View File

@@ -82,7 +82,7 @@ script void P_CBI_PTick(struct player *p) {

if(p->cbi.theme != p->cbi.oldtheme) {
#define X(n) ":UI_" n ":"
static cstr names[] = {
static cstr const names[] = {
X("Green"),
X("Rose"),
X("Umi"),


+ 1
- 1
source/p_gui_bip.c View File

@@ -27,7 +27,7 @@ static void EncryptedBody(struct page *p, char *bodytext) {
}

static void MailBody(struct page *p, char *bodytext) {
char remote[64];
char remote[128];
strcpy(remote, LanguageC(LANG "INFO_REMOT_%s", p->info->name));

cstr sent = CanonTime(ct_full, p->flags & _page_time);


+ 1
- 1
tools/infc.rb View File

@@ -97,7 +97,7 @@ _end_h_

/* Extern Objects ---------------------------------------------------------- */

struct pageinfo bipinfo[BIP_MAX] = {
struct pageinfo const bipinfo[BIP_MAX] = {
#{
res = String.new
for cna, cda in cat


Loading…
Cancel
Save