Browse Source

fix bad code and null pointer errors

tags/1.6.2
Alison Watson 1 year ago
parent
commit
a0ddc4ffcd
25 changed files with 80 additions and 106 deletions
  1. +4
    -4
      filedata/en/Arsenal_Upgrades.txt
  2. +4
    -4
      filedata/jp/Arsenal_Upgrades.txt
  3. BIN
      pk7/acs/lithmain.bin
  4. +4
    -4
      pk7/language.arsenal.en.txt
  5. +4
    -4
      pk7/language.arsenal.jp.txt
  6. +3
    -3
      pk7/lzscript/Constants/u_names.zsc
  7. +12
    -27
      source/Headers/u_data.h
  8. +14
    -14
      source/Headers/u_func.h
  9. +3
    -3
      source/Headers/u_names.h
  10. +0
    -9
      source/Main/p_upgrades.c
  11. +3
    -3
      source/Main/p_upgrinfo.c
  12. +2
    -3
      source/Main/u_adrenaline.c
  13. +4
    -4
      source/Main/u_headsupdisc.c
  14. +4
    -4
      source/Main/u_headsupdisd.c
  15. +5
    -5
      source/Main/u_headsupdism.c
  16. +1
    -1
      source/Main/u_homingrpg.c
  17. +2
    -3
      source/Main/u_jetbooster.c
  18. +1
    -1
      source/Main/u_lolsords.c
  19. +1
    -1
      source/Main/u_magic.c
  20. +1
    -1
      source/Main/u_reactarmor.c
  21. +2
    -2
      source/Main/u_reflexwetw.c
  22. +1
    -1
      source/Main/u_stealthsys.c
  23. +1
    -1
      source/Main/u_vitalscan.c
  24. +1
    -1
      source/Main/u_zoom.c
  25. +3
    -3
      source/Upgrades.txt

+ 4
- 4
filedata/en/Arsenal_Upgrades.txt View File

@@ -1,13 +1,13 @@
## Body ----------------------------------------------------------------------|
== \#UPGRADE_TITLE_HeadsUpDisp | Heads Up Disp.
@@ \#UPGRADE_EFFEC_HeadsUpDisp
== \#UPGRADE_TITLE_HeadsUpDisM | Heads Up Disp.
@@ \#UPGRADE_EFFEC_HeadsUpDisM
Shows vital information.

A Heads Up Display program built into your Computer/Brain Interface.

##----------------------------------------------------------------------------|
== \#UPGRADE_TITLE_HeadsUpDis2 | $\#UPGRADE_TITLE_HeadsUpDisp
@@ \#UPGRADE_EFFEC_HeadsUpDis2
== \#UPGRADE_TITLE_HeadsUpDisC | $\#UPGRADE_TITLE_HeadsUpDisM
@@ \#UPGRADE_EFFEC_HeadsUpDisC
Shows vital information.

A Heads Up Display program.


+ 4
- 4
filedata/jp/Arsenal_Upgrades.txt View File

@@ -1,13 +1,13 @@
## Body ----------------------------------------------------------------------|
== \#UPGRADE_TITLE_HeadsUpDisp | HUD
@@ \#UPGRADE_EFFEC_HeadsUpDisp
== \#UPGRADE_TITLE_HeadsUpDisM | HUD
@@ \#UPGRADE_EFFEC_HeadsUpDisM
重要な情報を表示。

機械脳技術/コンピューターに組み込まれたヘッドアップ ディスプレイ プログラム。

##----------------------------------------------------------------------------|
== \#UPGRADE_TITLE_HeadsUpDis2 | $\#UPGRADE_TITLE_HeadsUpDisp
@@ \#UPGRADE_EFFEC_HeadsUpDis2
== \#UPGRADE_TITLE_HeadsUpDisC | $\#UPGRADE_TITLE_HeadsUpDisM
@@ \#UPGRADE_EFFEC_HeadsUpDisC
生体情報を表示。

HUDプログラムです。


BIN
pk7/acs/lithmain.bin View File


+ 4
- 4
pk7/language.arsenal.en.txt View File

@@ -82,15 +82,15 @@


/* Body ----------------------------------------------------------------------|*/
"LITH_UPGRADE_TITLE_HeadsUpDisp" = "Heads Up Disp.";
"LITH_UPGRADE_EFFEC_HeadsUpDisp" =
"LITH_UPGRADE_TITLE_HeadsUpDisM" = "Heads Up Disp.";
"LITH_UPGRADE_EFFEC_HeadsUpDisM" =
"Shows vital information."
"\n\n"
"A Heads Up Display program built into your Computer/Brain Interface.";

/*----------------------------------------------------------------------------|*/
"LITH_UPGRADE_TITLE_HeadsUpDis2" = "$LITH_UPGRADE_TITLE_HeadsUpDisp";
"LITH_UPGRADE_EFFEC_HeadsUpDis2" =
"LITH_UPGRADE_TITLE_HeadsUpDisC" = "$LITH_UPGRADE_TITLE_HeadsUpDisM";
"LITH_UPGRADE_EFFEC_HeadsUpDisC" =
"Shows vital information."
"\n\n"
"A Heads Up Display program.";


+ 4
- 4
pk7/language.arsenal.jp.txt View File

@@ -70,15 +70,15 @@


/* Body ----------------------------------------------------------------------|*/
"LITH_UPGRADE_TITLE_HeadsUpDisp" = "HUD";
"LITH_UPGRADE_EFFEC_HeadsUpDisp" =
"LITH_UPGRADE_TITLE_HeadsUpDisM" = "HUD";
"LITH_UPGRADE_EFFEC_HeadsUpDisM" =
"重要な情報を表示。"
"\n\n"
"機械脳技術/コンピューターに組み込まれたヘッドアップ ディスプレイ プログラム。";

/*----------------------------------------------------------------------------|*/
"LITH_UPGRADE_TITLE_HeadsUpDis2" = "$LITH_UPGRADE_TITLE_HeadsUpDisp";
"LITH_UPGRADE_EFFEC_HeadsUpDis2" =
"LITH_UPGRADE_TITLE_HeadsUpDisC" = "$LITH_UPGRADE_TITLE_HeadsUpDisM";
"LITH_UPGRADE_EFFEC_HeadsUpDisC" =
"生体情報を表示。"
"\n\n"
"HUDプログラムです。";


+ 3
- 3
pk7/lzscript/Constants/u_names.zsc View File

@@ -19,9 +19,9 @@

enum UpgradeName
{
UPGR_HeadsUpDisp,
UPGR_HeadsUpDis2,
UPGR_HeadsUpDis3,
UPGR_HeadsUpDisM,
UPGR_HeadsUpDisC,
UPGR_HeadsUpDisD,
UPGR_JetBooster,
UPGR_ReflexWetw,
UPGR_Zoom,


+ 12
- 27
source/Headers/u_data.h View File

@@ -19,19 +19,6 @@
#define UPGR_STATIC_MAX 80
#define UPGR_EXTRA_NUM (UPGR_STATIC_MAX - UPGR_BASE_MAX)

#define CastUData(u) ((struct upgr_data *)(u)->dataptr)
#define UData_Adrenaline(u) (CastUData(u)->u01)
#define UData_JetBooster(u) (CastUData(u)->u03)
#define UData_lolsords(u) (CastUData(u)->u04)
#define UData_ReactArmor(u) (CastUData(u)->u05)
#define UData_ReflexWetw(u) (CastUData(u)->u06)
#define UData_VitalScan(u) (CastUData(u)->u07)
#define UData_Zoom(u) (CastUData(u)->u08)
#define UData_HomingRPG(u) (CastUData(u)->u09)
#define UData_Magic(u) (CastUData(u)->u10)
#define UData_StealthSys(u) (CastUData(u)->u11)
#define UData_HeadsUpDisp(u) (CastUData(u)->u13)

enum
{
UC_Body,
@@ -122,22 +109,22 @@ struct upgr_data_StealthSys {
k32 mulvel;
};

struct upgr_data_HeadsUpDisp {
struct upgr_data_HeadsUpDisM {
i32 cr;
};

struct upgr_data {
struct upgr_data_Adrenaline u01;
struct upgr_data_JetBooster u03;
struct upgr_data_lolsords u04;
struct upgr_data_ReactArmor u05;
struct upgr_data_ReflexWetw u06;
struct upgr_data_VitalScan u07;
struct upgr_data_Zoom u08;
struct upgr_data_HomingRPG u09;
struct upgr_data_Magic u10;
struct upgr_data_StealthSys u11;
struct upgr_data_HeadsUpDisp u13;
struct upgr_data_Adrenaline adrenaline;
struct upgr_data_JetBooster jetbooster;
struct upgr_data_lolsords lolsords;
struct upgr_data_ReactArmor reactarmor;
struct upgr_data_ReflexWetw reflexwetw;
struct upgr_data_VitalScan vitalscan;
struct upgr_data_Zoom zoom;
struct upgr_data_HomingRPG homingrpg;
struct upgr_data_Magic magic;
struct upgr_data_StealthSys stealthsys;
struct upgr_data_HeadsUpDisM headsupdism;
};

struct upgradeinfo {
@@ -165,8 +152,6 @@ bool P_Upg_Toggle(struct player *p, struct upgrade *upgr);
void P_Upg_SetOwned(struct player *p, struct upgrade *upgr);

struct upgrade {
void *dataptr;

struct upgrade *next, **prev;

struct upgradeinfo const *info;


+ 14
- 14
source/Headers/u_func.h View File

@@ -14,20 +14,20 @@

#include "u_func_beg.h"

Case(HeadsUpDisp)
A(HeadsUpDisp)
D(HeadsUpDisp)
R(HeadsUpDisp)
Case(HeadsUpDis2)
A(HeadsUpDis2)
D(HeadsUpDis2)
R(HeadsUpDis2)
Case(HeadsUpDis3)
A(HeadsUpDis3)
D(HeadsUpDis3)
R(HeadsUpDis3)
Case(HeadsUpDisM)
A(HeadsUpDisM)
D(HeadsUpDisM)
R(HeadsUpDisM)
Case(HeadsUpDisC)
A(HeadsUpDisC)
D(HeadsUpDisC)
R(HeadsUpDisC)
Case(HeadsUpDisD)
A(HeadsUpDisD)
D(HeadsUpDisD)
R(HeadsUpDisD)

Case(JetBooster)
A(JetBooster)


+ 3
- 3
source/Headers/u_names.h View File

@@ -15,9 +15,9 @@

enum /* UpgradeName */
{
UPGR_HeadsUpDisp,
UPGR_HeadsUpDis2,
UPGR_HeadsUpDis3,
UPGR_HeadsUpDisM,
UPGR_HeadsUpDisC,
UPGR_HeadsUpDisD,
UPGR_JetBooster,
UPGR_ReflexWetw,
UPGR_Zoom,


+ 0
- 9
source/Main/p_upgrades.c View File

@@ -56,12 +56,6 @@ static i32 CompUpgrInfo(void const *lhs, void const *rhs)
else return u1->key - u2->key;
}

stkcall
static void SetDataPtr(struct player *p, struct upgrade *upgr)
{
upgr->dataptr = &p->upgrdata;
}

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

struct upgradeinfo *Upgr_Register(struct upgradeinfo const *upgr)
@@ -78,8 +72,6 @@ void Upgr_MInit(void)
struct upgradeinfo *ui = &g_upgrinfo[i];

/* Set up static function pointers */
ui->Init = SetDataPtr; /* this is set again by UpgrReinit */

ui->ShopBuy = UpgrShopBuy;
ui->ShopCanBuy = UpgrCanBuy;
ui->ShopGive = UpgrGive;
@@ -138,7 +130,6 @@ void P_Upg_PInit(struct player *p)
{
struct upgrade *upgr = &p->upgrades[j];

g_upgrinfo[i].Init(p, upgr);
upgr->info = &g_upgrinfo[i];

p->upgrademap.insert(upgr);


+ 3
- 3
source/Main/p_upgrinfo.c View File

@@ -19,9 +19,9 @@ StrEntON
/* Extern Objects ---------------------------------------------------------- */

struct upgradeinfo const upgrinfobase[UPGR_BASE_MAX] = {
{{"HeadsUpDisp", "HeadsUpDisp", 0}, pM|pX, UC_Body, 1, UG_HUD, 0, -.05, UPGR_HeadsUpDisp},
{{"HeadsUpDis2", "HeadsUpDisp", 0}, pC, UC_Body, 1, UG_HUD, 0, -.05, UPGR_HeadsUpDis2},
{{"HeadsUpDis3", "HeadsUpDisp", 0}, pD, UC_Body, 1, UG_HUD, 0, -.05, UPGR_HeadsUpDis3},
{{"HeadsUpDisM", "HeadsUpDisp", 0}, pM|pX, UC_Body, 1, UG_HUD, 0, -.05, UPGR_HeadsUpDisM},
{{"HeadsUpDisC", "HeadsUpDisp", 0}, pC, UC_Body, 1, UG_HUD, 0, -.05, UPGR_HeadsUpDisC},
{{"HeadsUpDisD", "HeadsUpDisp", 0}, pD, UC_Body, 1, UG_HUD, 0, -.05, UPGR_HeadsUpDisD},
{{"JetBooster", "JetBooster", 0}, pM, UC_Body, 0, 0, 0, -.05, UPGR_JetBooster},
{{"ReflexWetw", "ReflexWetw", 0}, gO|pX, UC_Body, 5, 0, 0, -.05, UPGR_ReflexWetw},
{{"Zoom", 0, 0}, gA, UC_Body, 0, 0, 0, 0, UPGR_Zoom},


+ 2
- 3
source/Main/u_adrenaline.c View File

@@ -13,7 +13,7 @@

#include "u_common.h"

#define UData UData_Adrenaline(upgr)
#define UData p->upgrdata.adrenaline
#define CHARGE_MAX (35 * 30)

/* Extern Functions -------------------------------------------------------- */
@@ -52,7 +52,7 @@ void Upgr_Adrenaline_Update(struct player *p, struct upgrade *upgr)
stkcall
void Upgr_Adrenaline_Render(struct player *p, struct upgrade *upgr)
{
if(!p->getUpgrActive(UPGR_HeadsUpDisp)) return;
if(!p->getUpgrActive(UPGR_HeadsUpDisM)) return;

i32 timemod = p->ticks % 45;
k64 amt = UData.charge / (k64)CHARGE_MAX;
@@ -68,4 +68,3 @@ void Upgr_Adrenaline_Render(struct player *p, struct upgrade *upgr)
}

/* EOF */


source/Main/u_headsupdis2.c → source/Main/u_headsupdisc.c View File

@@ -6,7 +6,7 @@
*
* ---------------------------------------------------------------------------|
*
* HeadsUpDis2 upgrade.
* HeadsUpDisC upgrade.
*
* ---------------------------------------------------------------------------|
*/
@@ -82,19 +82,19 @@ static void HUD_Health(struct player *p)
/* Extern Functions -------------------------------------------------------- */

stkcall
void Upgr_HeadsUpDis2_Activate(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisC_Activate(struct player *p, struct upgrade *upgr)
{
p->hudenabled = true;
}

stkcall
void Upgr_HeadsUpDis2_Deactivate(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisC_Deactivate(struct player *p, struct upgrade *upgr)
{
p->hudenabled = false;
}

stkcall
void Upgr_HeadsUpDis2_Render(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisC_Render(struct player *p, struct upgrade *upgr)
{
if(p->dlg.active) return;


source/Main/u_headsupdis3.c → source/Main/u_headsupdisd.c View File

@@ -6,7 +6,7 @@
*
* ---------------------------------------------------------------------------|
*
* HeadsUpDis3 upgrade.
* HeadsUpDisD upgrade.
*
* ---------------------------------------------------------------------------|
*/
@@ -87,19 +87,19 @@ static void HUD_Health(struct player *p)
/* Extern Functions -------------------------------------------------------- */

stkcall
void Upgr_HeadsUpDis3_Activate(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisD_Activate(struct player *p, struct upgrade *upgr)
{
p->hudenabled = true;
}

stkcall
void Upgr_HeadsUpDis3_Deactivate(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisD_Deactivate(struct player *p, struct upgrade *upgr)
{
p->hudenabled = false;
}

stkcall
void Upgr_HeadsUpDis3_Render(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisD_Render(struct player *p, struct upgrade *upgr)
{
if(p->dlg.active) return;


source/Main/u_headsupdisp.c → source/Main/u_headsupdism.c View File

@@ -6,7 +6,7 @@
*
* ---------------------------------------------------------------------------|
*
* HeadsUpDisp upgrade.
* HeadsUpDisM upgrade.
*
* ---------------------------------------------------------------------------|
*/
@@ -14,7 +14,7 @@
#include "u_common.h"
#include "p_hud.h"

#define UData UData_HeadsUpDisp(upgr)
#define UData p->upgrdata.headsupdism

/* Static Functions -------------------------------------------------------- */

@@ -127,19 +127,19 @@ static void HUD_Health(struct player *p, struct upgrade *upgr)
/* Extern Functions -------------------------------------------------------- */

stkcall
void Upgr_HeadsUpDisp_Activate(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisM_Activate(struct player *p, struct upgrade *upgr)
{
p->hudenabled = true;
}

stkcall
void Upgr_HeadsUpDisp_Deactivate(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisM_Deactivate(struct player *p, struct upgrade *upgr)
{
p->hudenabled = false;
}

stkcall
void Upgr_HeadsUpDisp_Render(struct player *p, struct upgrade *upgr)
void Upgr_HeadsUpDisM_Render(struct player *p, struct upgrade *upgr)
{
if(p->dlg.active) return;


+ 1
- 1
source/Main/u_homingrpg.c View File

@@ -14,7 +14,7 @@
#include "u_common.h"
#include "w_world.h"

#define UData UData_HomingRPG(upgr)
#define UData p->upgrdata.homingrpg

/* Static Functions -------------------------------------------------------- */



+ 2
- 3
source/Main/u_jetbooster.c View File

@@ -13,7 +13,7 @@

#include "u_common.h"

#define UData UData_JetBooster(upgr)
#define UData p->upgrdata.jetbooster

#define CHARGE_MAX (35 * 7)

@@ -44,7 +44,7 @@ void Upgr_JetBooster_Update(struct player *p, struct upgrade *upgr)
P_SetVel(p, p->velx + (ACS_Cos(angle) * 16.0), p->vely + (ACS_Sin(angle) * 16.0), 10.0);

UData.charge = 0;
UData_ReflexWetw(p->getUpgr(UPGR_ReflexWetw)).leaped = 0;
p->upgrdata.reflexwetw.leaped = 0;
}
}

@@ -74,4 +74,3 @@ void Upgr_JetBooster_Render(struct player *p, struct upgrade *upgr)
}

/* EOF */


+ 1
- 1
source/Main/u_lolsords.c View File

@@ -13,7 +13,7 @@

#include "u_common.h"

#define UData UData_lolsords(upgr)
#define UData p->upgrdata.lolsords

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



+ 1
- 1
source/Main/u_magic.c View File

@@ -14,7 +14,7 @@
#include "u_common.h"
#include "w_world.h"

#define UData UData_Magic(upgr)
#define UData p->upgrdata.magic

/* Types ------------------------------------------------------------------- */



+ 1
- 1
source/Main/u_reactarmor.c View File

@@ -13,7 +13,7 @@

#include "u_common.h"

#define UData UData_ReactArmor(upgr)
#define UData p->upgrdata.reactarmor

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



+ 2
- 2
source/Main/u_reflexwetw.c View File

@@ -13,7 +13,7 @@

#include "u_common.h"

#define UData UData_ReflexWetw(upgr)
#define UData p->upgrdata.reflexwetw

#define CHARGE_MAX (35 * 0.8)

@@ -68,7 +68,7 @@ void Upgr_ReflexWetw_Update(struct player *p, struct upgrade *upgr)

if(p->buttons & BT_SPEED && (p->onground ||
!p->getUpgrActive(UPGR_JetBooster) ||
UData_JetBooster(p->getUpgr(UPGR_JetBooster)).discharged))
p->upgrdata.jetbooster.discharged))
{
k32 angle = p->yaw - ACS_VectorAngle(p->forwardv, p->sidev);



+ 1
- 1
source/Main/u_stealthsys.c View File

@@ -13,7 +13,7 @@

#include "u_common.h"

#define UData UData_StealthSys(upgr)
#define UData p->upgrdata.stealthsys

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



+ 1
- 1
source/Main/u_vitalscan.c View File

@@ -17,7 +17,7 @@

#include <math.h>

#define UData UData_VitalScan(upgr)
#define UData p->upgrdata.vitalscan

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



+ 1
- 1
source/Main/u_zoom.c View File

@@ -15,7 +15,7 @@

#include <math.h>

#define UData UData_Zoom(upgr)
#define UData p->upgrdata.zoom

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



+ 3
- 3
source/Upgrades.txt View File

@@ -7,9 +7,9 @@ Plus denotes an upgrade. Any other text is ignored by the parser.

Name Info Page [Cost] Cl Funcs [Pr] [[-].Score Mul] [Group] [(Req)]
:Body
+HeadsUpDisp HeadsUpDisp pM|pX AD-R- 1 -.05 HUD
+HeadsUpDis2 HeadsUpDisp pC AD-R- 1 -.05 HUD
+HeadsUpDis3 HeadsUpDisp pD AD-R- 1 -.05 HUD
+HeadsUpDisM HeadsUpDisp pM|pX AD-R- 1 -.05 HUD
+HeadsUpDisC HeadsUpDisp pC AD-R- 1 -.05 HUD
+HeadsUpDisD HeadsUpDisp pD AD-R- 1 -.05 HUD
+JetBooster JetBooster pM A-UR- -.05
+ReflexWetw ReflexWetw gO|pX ADU-- 5 -.05
+Zoom - gA -DUR-


Loading…
Cancel
Save