Skip to content
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

Spelling - Improved Ore Armor (DE/EN) #149

Merged
merged 5 commits into from Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

## v1.1.0 (TBA)
### General
* Fix #149: The armor "Improved ore Armor" is now correctly labeled as "Improved Ore Armor".
* Fix #192: Mages (NPCs fighting only with spells) no longer auto-equip weapons (e.g. after trading). This requires fix #59 to be active.

### Story
Expand Down
1 change: 1 addition & 0 deletions docs/changelog_de.md
Expand Up @@ -3,6 +3,7 @@
## v1.1.0 (TBA)
### General
* Fix #144: Den Namen "Gomez'Rüstung" korrigiert zu "Gomez' Rüstung".
* Fix #149: Der Name "verbesserte Erzrüstung" ist nun korrigiert zu "Verbesserte Erzrüstung".
* Fix #192: Magier (NSCs, die nur mit Magie kämpfen) rüsten nicht länger automatisch Nah- und Fernkampfwaffen aus (z.B. nach dem Handeln). Dieser Fix setzt den Fix #59 voraus.

### Story
Expand Down
@@ -0,0 +1,16 @@
/*
* #149 Spelling - Improved Ore Armor (DE/EN)
*/
func int G1CP_149_DE_EN_ImprovedOreArmorName() {
var int symbId; symbId = MEM_GetSymbolIndex("ORE_ARMOR_H");
const string needle = "G1CP invalid string";
const string replace = "G1CP invalid string";
if (G1CP_Lang == G1CP_Lang_DE) {
needle = "verbesserte Erzr�stung";
replace = "Verbesserte Erzr�stung";
} else if (G1CP_Lang == G1CP_Lang_EN) {
needle = "Improved ore Armor";
replace = "Improved Ore Armor";
};
return (G1CP_ReplaceAssignStr(symbId, "C_Item.name", 0, needle, replace) > 0);
AmProsius marked this conversation as resolved.
Show resolved Hide resolved
};
38 changes: 38 additions & 0 deletions src/Ninja/G1CP/Content/Tests/test149.d
@@ -0,0 +1,38 @@
/*
* #149 Spelling - Improved Ore Armor (DE/EN)
*
* The text of the item "ORE_ARMOR_H" is inspected programmatically.
*
* Expected behavior: The armor will have the correct name (checked for English and German localization only).
*/
func int G1CP_Test_149() {
// Check language first
if (G1CP_Lang != G1CP_Lang_EN) && (G1CP_Lang != G1CP_Lang_DE) {
G1CP_TestsuiteErrorDetail("Test applicable for English and German localization only");
return TRUE; // True?
};

// Check if item exists
var int symbId; symbId = MEM_GetSymbolIndex("ORE_ARMOR_H");
if (symbId == -1) {
G1CP_TestsuiteErrorDetail("Item 'ORE_ARMOR_H' not found");
return FALSE;
};

// Create the armor locally
if (Itm_GetPtr(symbId)) {
if (Hlp_StrCmp(item.name, "Improved Ore Armor")) // EN
|| (Hlp_StrCmp(item.name, "Verbesserte Erzrüstung")) { // DE
return TRUE;
} else {
var string msg; msg = "Text incorrect: name = '";
msg = ConcatStrings(msg, item.name);
msg = ConcatStrings(msg, "'");
G1CP_TestsuiteErrorDetail(msg);
return FALSE;
};
} else {
G1CP_TestsuiteErrorDetail("Item 'ORE_ARMOR_H' could not be created");
return FALSE;
};
};
1 change: 1 addition & 0 deletions src/Ninja/G1CP/Content/patchInit.d
Expand Up @@ -58,6 +58,7 @@ func void Ninja_G1CP_Menu(var int menuPtr) {
G1CP_126_SharkyTrade(); // #126
G1CP_136_FollowLadder(); // #136
G1CP_144_DE_GomezArmorName(); // #144
G1CP_149_DE_EN_ImprovedOreArmorName(); // #149
G1CP_157_SpeedPotion2Value(); // #157
G1CP_158_SpeedPotion3Value(); // #158
G1CP_163_CastleGate(); // #163
Expand Down
2 changes: 2 additions & 0 deletions src/Ninja/G1CP/Content_G1.src
Expand Up @@ -78,6 +78,7 @@ Content\Fixes\Session\fix125_ButcherText.d
Content\Fixes\Session\fix126_SharkyTrade.d
Content\Fixes\Session\fix136_FollowLadder.d
Content\Fixes\Session\fix144_DE_GomezArmorName.d
Content\Fixes\Session\fix149_DE_EN_ImprovedOreArmorName.d
Content\Fixes\Session\fix157_SpeedPotion2Value.d
Content\Fixes\Session\fix158_SpeedPotion3Value.d
Content\Fixes\Session\fix163_CastleGate.d
Expand Down Expand Up @@ -144,6 +145,7 @@ Content\Tests\test125.d
Content\Tests\test126.d
Content\Tests\test136.d
Content\Tests\test144.d
Content\Tests\test149.d
Content\Tests\test157.d
Content\Tests\test158.d
Content\Tests\test163.d
Expand Down