Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
81c5e520
Commit
81c5e520
authored
12 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Fix loading of legacy chests
parent
9c3830dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/content_nodemeta.cpp
+7
-8
7 additions, 8 deletions
src/content_nodemeta.cpp
src/inventory.cpp
+5
-0
5 additions, 0 deletions
src/inventory.cpp
src/inventory.h
+1
-0
1 addition, 0 deletions
src/inventory.h
with
13 additions
and
8 deletions
src/content_nodemeta.cpp
+
7
−
8
View file @
81c5e520
...
...
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include
"inventory.h"
#include
"log.h"
#include
"utility.h"
#include
<sstream>
#define NODEMETA_GENERIC 1
#define NODEMETA_SIGN 14
...
...
@@ -70,11 +71,10 @@ static bool content_nodemeta_deserialize_legacy_body(
// Rename inventory list "0" to "main"
Inventory
*
inv
=
meta
->
getInventory
();
if
(
!
inv
->
getList
(
"main"
)
&&
inv
->
getList
(
"0"
)){
inv
->
addList
(
"main"
,
8
*
4
);
*
inv
->
getList
(
"main"
)
=
*
inv
->
getList
(
"0"
);
inv
->
deleteList
(
"0"
);
inv
->
getList
(
"0"
)
->
setName
(
"main"
);
}
assert
(
inv
->
getList
(
"main"
)
&&
!
inv
->
getList
(
"0"
));
meta
->
setString
(
"formspec"
,
"invsize[8,9;]"
"list[current_name;main;0,0;8,4;]"
"list[current_player;main;0,5;8,4;]"
);
...
...
@@ -88,11 +88,10 @@ static bool content_nodemeta_deserialize_legacy_body(
// Rename inventory list "0" to "main"
Inventory
*
inv
=
meta
->
getInventory
();
if
(
!
inv
->
getList
(
"main"
)
&&
inv
->
getList
(
"0"
)){
inv
->
addList
(
"main"
,
8
*
4
);
*
inv
->
getList
(
"main"
)
=
*
inv
->
getList
(
"0"
);
inv
->
deleteList
(
"0"
);
inv
->
getList
(
"0"
)
->
setName
(
"main"
);
}
assert
(
inv
->
getList
(
"main"
)
&&
!
inv
->
getList
(
"0"
));
meta
->
setString
(
"formspec"
,
"invsize[8,9;]"
"list[current_name;main;0,0;8,4;]"
"list[current_player;main;0,5;8,4;]"
);
...
...
This diff is collapsed.
Click to expand it.
src/inventory.cpp
+
5
−
0
View file @
81c5e520
...
...
@@ -458,6 +458,11 @@ void InventoryList::setSize(u32 newsize)
m_size
=
newsize
;
}
void
InventoryList
::
setName
(
const
std
::
string
&
name
)
{
m_name
=
name
;
}
void
InventoryList
::
serialize
(
std
::
ostream
&
os
)
const
{
//os.imbue(std::locale("C"));
...
...
This diff is collapsed.
Click to expand it.
src/inventory.h
+
1
−
0
View file @
81c5e520
...
...
@@ -176,6 +176,7 @@ class InventoryList
~
InventoryList
();
void
clearItems
();
void
setSize
(
u32
newsize
);
void
setName
(
const
std
::
string
&
name
);
void
serialize
(
std
::
ostream
&
os
)
const
;
void
deSerialize
(
std
::
istream
&
is
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment