Skip to content

Commit 6fb35db

Browse files
authored
Minor fixes (#663)
* Use VS 2022 * Add gitignore * Fix feline brackets * Fix Aslona wizard RAND call * Fix tailoring mode save, where info loads twice Fixes #592, #669 --------- Co-authored-by: red_kangaroo Co-authored-by: ryfactor
1 parent d3cc5f8 commit 6fb35db

File tree

6 files changed

+101
-32
lines changed

6 files changed

+101
-32
lines changed

.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Do not track these files.
2+
3+
# Node artifact files
4+
node_modules/
5+
dist/
6+
7+
# Compiled Java class files
8+
*.class
9+
10+
# Compiled Python bytecode
11+
*.py[cod]
12+
__pycache__
13+
14+
# Log files
15+
log/
16+
*.log
17+
18+
# Package files
19+
*.jar
20+
/*egg-info/
21+
22+
# Maven
23+
target/
24+
25+
# JetBrains IDE
26+
.idea/
27+
venv/
28+
29+
# Visual Studio
30+
.vs*
31+
32+
# Unit test reports
33+
TEST*.xml
34+
35+
# Generated by MacOS
36+
.DS_Store
37+
38+
# Generated by Windows
39+
Thumbs.db
40+
41+
# Applications
42+
*.app
43+
*.exe
44+
*.war
45+
46+
# Large media files
47+
*.mp4
48+
*.tiff
49+
*.avi
50+
*.flv
51+
*.mov
52+
*.wmv
53+
54+
# Temporary files
55+
~$*.doc*
56+
~$*.xls*
57+
~$*.ppt*

CMakeSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"configurations": [
33
{
44
"name": "x86-Release",
5-
"generator": "Visual Studio 15 2017",
5+
"generator": "Visual Studio 17 2022",
66
"configurationType": "Release",
77
"inheritEnvironments": [
88
"msvc_x86"

INSTALL

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ cd build
1919
cmake .. # ".." refers to the parent directory of "build"
2020
make
2121
make install
22-
Note: This will make changes to /usr/bin, and you have to either run "sudo make install" instead, or log in as root.
22+
23+
Note: This will make changes to /usr/bin, and you have to either run "sudo make install" instead, or log in as root.
2324
Note: Wizard Mode is disabled by default. To enable it run:
2425

2526
mkdir build
@@ -40,19 +41,19 @@ like this: CMAKE_CXX_FLAGS="-DFELIST_WAITKEYUP"
4041

4142
Under DOS:
4243

43-
If you have DJGPP 2.03+ and gcc 2.952+
44-
installed, type:
44+
If you have DJGPP 2.03+ and gcc 2.952+ installed, type:
4545

4646
make -f ivandj.mak
4747

4848
--------------------------------------
4949

50-
Under Windows - Microsoft Visual Studio 2017 (or better):
50+
Under Windows - Microsoft Visual Studio 2022:
5151

52-
You will need to install the C++ tools with CMake support, along with Git integrations from the Visual Studio Installer.
53-
We will not be using Visual Studio in the traditional way with everything squished into a solution file.
54-
Instead we will use Visual Studio to open a repo folder with a top-level CMakeLists.txt, in conjunction with a CMakeSettings.json file to create the cmake build files.
55-
Then we will use msvc to compile ivan.exe, with the help of libraries we install from vcpkg using Powershell (PS).
52+
You will need to install the C++ tools with CMake support, along with Git integrations from the Visual Studio Installer.
53+
We will not be using Visual Studio in the traditional way with everything squished into a solution file.
54+
Instead we will use Visual Studio to open a repo folder with a top-level CMakeLists.txt, in conjunction with
55+
a CMakeSettings.json file to create the cmake build files.
56+
Then we will use msvc to compile ivan.exe, with the help of libraries we install from vcpkg using Powershell (PS).
5657

5758
Install vcpkg and install the needed libraries using Powershell:
5859
Here is a condensed summary of applicable instructions from https://github.com/microsoft/vcpkg
@@ -76,15 +77,16 @@ zlib:x86-windows 1.2.11-5 A compressio
7677

7778
Clone attnam/ivan into a directory (for example C:\Users\yourname\source\repos\ivan)
7879

79-
Open Microsoft Visual Studio (2017)
80+
Open Microsoft Visual Studio 2022
8081

8182
Go File->Open Folder
8283

8384
Select C:\Users\yourname\source\repos\ivan
8485

8586
Some stuff will happen automatically. The CMakeSettings.json file will be found, and the CMake cache will be generated.
8687

87-
Next to the green "play" button is some text (Select Startup Item...) in a gray dropdown menu. Select "ivan.exe (Install) (ivan\ivan.exe)".
88+
Next to the green "play" button is some text (Select Startup Item...) in a gray dropdown menu.
89+
Select "ivan.exe (Install) (ivan\ivan.exe)".
8890

8991
"Build" will appear in the menu next to "CMake". Click Build->ivan.exe (Install) (ivan\ivan.exe) F7
9092

@@ -93,6 +95,14 @@ This will build ivan.exe and install all the components, automatically copying t
9395
The build folder is located in C:\Users\yourname\CMakeBuilds\some-long-code-here-abcdef123456\install\x86-Release\ivan
9496
Go there and hit ivan.exe, and you're playing IVAN built using Microsoft Visual Studio!!!
9597

98+
--------------------------------------
99+
100+
Under Windows - Microsoft Visual Studio OTHER THAN 2022:
101+
102+
Instructions are the same as for Microsoft Visual Studio 2022, except that you must open CMakeSettings.json
103+
in the project folder and change the generator to your version of VS. For example:
104+
105+
"generator": "Visual Studio 15 2017"
96106

97107
--------------------------------------
98108

@@ -136,11 +146,13 @@ Follow instructions on the page to install correctly.
136146

137147
Run MSYS2.exe from either the "-msys64" or "-msys32" folder, depending on your system, and type these commands
138148
$ pacman -Syu
139-
Proceed with installation (option Y), then exit by closing the terminal window. The terminal window will crash and burn eventually but may take some time to do so.
149+
Proceed with installation (option Y), then exit by closing the terminal window.
150+
The terminal window will crash and burn eventually but may take some time to do so.
140151

141152
Run MSYS2.exe again:
142153
$ pacman -Su
143-
proceed with installation (option Y). This will take a long time to download all the packages, depending on your download speed
154+
Proceed with installation (option Y).
155+
This will take a long time to download all the packages, depending on your download speed.
144156

145157
$ pacman -S git
146158
Proceed with installation (option Y) etcetera
@@ -159,18 +171,20 @@ $ pacman -S mingw-w64-i686-SDL2_mixer
159171

160172
$ pacman -S mingw-w64-i686-pkg-config
161173

162-
Now the MSYS2 build system is installed, you only need to follow the instructions below to keep IVAN up to date
174+
Now the MSYS2 build system is installed, you only need to follow the instructions below to keep IVAN up to date.
163175

164176
Create an empty folder in \ivan\ called msys2
165-
run MinGW32.exe (from your "-msys64" or "-msys32" folder, whichever is applicable) and change directory to your newly created \ivan\msys2\ folder
177+
Run MinGW32.exe (from your "-msys64" or "-msys32" folder, whichever is applicable) and change directory to your
178+
newly created \ivan\msys2\ folder.
166179

167180
In MinGW32.exe type the following commands, respecting the direction of the slashes:
168181
$ cmake .. -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=C:/ivan/inst_msys2
169182
$ make -j4 install
170183

171184
Navigate to \ivan\inst_msys2\ivan and you will find the ivan.exe executable!
172185

173-
You will probably need to copy a bunch of DLLs into the directory where ivan.exe is located. These may include the following, likely not an exhaustive list, but they can be found under for example C:\-msys64\mingw32\bin:
186+
You will probably need to copy a bunch of DLLs into the directory where ivan.exe is located. These may include
187+
the following, likely not an exhaustive list, but they can be found under for example C:\-msys64\mingw32\bin:
174188
libpng16-16.dll
175189
libstdc++-6.dll
176190
libwinpthread-1.dll
@@ -180,7 +194,9 @@ libSDL2_mixer-2-0-0.dll
180194
libmad-0.dll
181195

182196

183-
Use dependencywalker if you need to check for missing libraries, and if you get the message: "error cannot find entrypoint inflateValidate (in dll libpng16-16.dll)" then you need to include zlib1.dll
197+
Use dependencywalker if you need to check for missing libraries, and if you get the message:
198+
"error cannot find entrypoint inflateValidate (in dll libpng16-16.dll)"
199+
then you need to include zlib1.dll
184200

185201
--------------------------------------
186202

Main/Source/cmdcraft.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,6 @@ void recipedata::Load(inputfile& SaveFile)
399399

400400
;
401401

402-
if(game::GetCurrentSavefileVersion() >= 135){
403-
SaveFile >> bTailoringMode;
404-
SaveFile >> v2TailoringWorkbenchLocation;
405-
}
406-
407402
// if(otSpawnType!=CTT_NONE)
408403
// SaveFile >> otSpawn;
409404
rc.integrityCheck();

Main/Source/human.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ truth humanoid::SwitchToCraft(recipedata rpd)
18891889
{DBGLN;
18901890
craft* Craft = craft::Spawn(this);DBGLN;
18911891
DBG4(rpd.GetTool(),rpd.GetTool2(),GetRightArm()?GetRightArm()->IsUsable():0,GetLeftArm()?GetLeftArm()->IsUsable():0);
1892-
1892+
18931893
bool b1OK=false;
18941894
bool b2OK=false;
18951895
item* it;
@@ -1901,7 +1901,7 @@ truth humanoid::SwitchToCraft(recipedata rpd)
19011901
b1OK=true;
19021902
Craft->SetMoveCraftTool(false);
19031903
}
1904-
1904+
19051905
if(!b1OK && GetRightArm() && GetRightArm()->IsUsable()){
19061906
if((it = GetRightWielded())){
19071907
Craft->SetRightBackupID(it->GetID());
@@ -1914,7 +1914,7 @@ truth humanoid::SwitchToCraft(recipedata rpd)
19141914
b1OK=true;
19151915
Craft->SetMoveCraftTool(true);
19161916
}
1917-
1917+
19181918
if(!b1OK && GetLeftArm() && GetLeftArm()->IsUsable()){
19191919
if((it = GetLeftWielded())){
19201920
Craft->SetLeftBackupID(it->GetID());
@@ -1927,19 +1927,19 @@ truth humanoid::SwitchToCraft(recipedata rpd)
19271927
b1OK=true;
19281928
Craft->SetMoveCraftTool(true);
19291929
}
1930-
1930+
19311931
}else{
19321932
b1OK=true; //can craft somethings w/o tools
19331933
}
1934-
1934+
19351935
//TODO let the GetTool2() be equipped too?
19361936

19371937
if(b1OK){
19381938
Craft->SetCraftWhat(rpd);DBGLN;
19391939
SetAction(Craft);DBGLN;
19401940
return true;
19411941
}
1942-
1942+
19431943
ADD_MESSAGE("You have no usable arm.");
19441944
rpd.SetAlreadyExplained();
19451945
return false;
@@ -5390,7 +5390,7 @@ void FixSumoWrestlerHouse(festring fsCmdParams)
53905390
break;
53915391
}
53925392
}
5393-
5393+
53945394
if(SM){
53955395
for(int d = 0; d < SM->GetNeighbourSquares(); ++d)
53965396
{
@@ -5412,7 +5412,7 @@ void sumowrestler::GetAICommand()
54125412
devcons::AddDevCmd("FixSumoHouse",FixSumoWrestlerHouse,
54135413
"BugFix sumo wrestler house in case banana growers over crowd it.");
54145414
return true;}();
5415-
5415+
54165416
EditNP(-25);
54175417

54185418
SeekLeader(GetLeader());
@@ -7227,7 +7227,7 @@ void aslonawizard::GetAICommand()
72277227
}
72287228

72297229
if(NearestEnemy && NearestEnemy->GetPos().IsAdjacent(Pos) &&
7230-
(!(RAND() & 4) || StateIsActivated(PANIC)))
7230+
(!(RAND() % 4) || StateIsActivated(PANIC)))
72317231
{
72327232
if(CanBeSeenByPlayer())
72337233
ADD_MESSAGE("%s invokes a spell and disappears.", CHAR_NAME(DEFINITE));

Main/Source/nonhuman.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,10 @@ truth feline::Catches(item* Thingy)
164164
if(CanBeSeenByPlayer())
165165
ADD_MESSAGE("%s catches %s and eats it.", CHAR_NAME(DEFINITE), Thingy->CHAR_NAME(DEFINITE));
166166

167-
if(PLAYER->GetRelativeDanger(this, true) > 0.1)
167+
if(PLAYER->GetRelativeDanger(this, true) > 0.1) {
168168
ChangeTeam(PLAYER->GetTeam());
169169
ADD_MESSAGE("%s seems to be much more friendly towards you.", CHAR_NAME(DEFINITE));
170+
}
170171
}
171172
}
172173
else if(IsPlayer())

0 commit comments

Comments
 (0)