-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/75 extract items csv #76
Conversation
…) Server Main changes
`G_Spawn`` is now a gameExports instance function, `walkmonster_start` is now a regular function (not adapter).
|
||
|
||
public class GameItemList { | ||
|
||
// RST: this was separated in the java conversion from the g_item.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this whole file will be removed when the PR is finished
@@ -380,12 +409,12 @@ private void Give_f(SubgameEntity ent, List<String> args) { | |||
|
|||
if (give_all || 0 == Lib.Q_stricmp(name, "items")) { | |||
|
|||
for (i = 1; i < game.num_items; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change might warrant an explanation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change of index happened because I removed to sacred objects in the game item list - the first null object and the last null object - see removed section in the GameItemList.java
@@ -107,7 +108,7 @@ public static void BeginIntermission(SubgameEntity targ, GameExportsImpl gameExp | |||
if (!client.inuse) | |||
continue; | |||
// strip players of all keys between units | |||
for (int n = 1; n < gameExports.items.itemlist.length; n++) { | |||
for (int n = 0; n < gameExports.items.itemlist.length; n++) { | |||
// null pointer exception fixed. (RST) | |||
if (gameExports.items.itemlist[n] != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this still be true? Since null values are removed
implementation("org.apache.commons:commons-csv:1.9.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first ever 3rd party library! (apart from lwjgl)
@@ -664,8 +699,8 @@ public void drop(SubgameEntity ent, gitem_t item, GameExportsImpl gameExports) { | |||
dropped.count = client.pers.inventory[index]; | |||
|
|||
if (client.pers.weapon != null | |||
&& client.pers.weapon.tag == GameDefines.AMMO_GRENADES | |||
&& item.tag == GameDefines.AMMO_GRENADES | |||
&& client.pers.weapon.classname.equals("ammo_grenades") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed tags in favour of the classname
Defines.ATTN_NORM, 0); | ||
power_armor_type = 0; | ||
; | ||
} | ||
} | ||
|
||
index = GameItems.ArmorIndex(ent, gameExports); | ||
if (power_armor_type != 0 | ||
&& (0 == index || 0 != (gameExports.level.framenum & 8))) { // flash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how such comment disorder is named?
public gitem_armor_t info; | ||
public String precaches; // string of all models, sounds, and images this item will | ||
|
||
private static final Map<String, Integer> ITEM_TYPE_MAP = Map.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these maps are for csv parsing
Extract item data from java code into csv resource