Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mapserver_mod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Minetest
mapserver_mod
Commits
6251b5a5
Commit
6251b5a5
authored
5 years ago
by
NatureFreshMilk
Browse files
Options
Downloads
Patches
Plain Diff
check every attribute value for nil
fixes
https://github.com/pandorabox-io/pandorabox.io/issues/424
parent
febcbe52
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
search.lua
+12
-6
12 additions, 6 deletions
search.lua
with
12 additions
and
6 deletions
search.lua
+
12
−
6
View file @
6251b5a5
...
...
@@ -89,17 +89,23 @@ local function show_formspec(playername, data)
local
description
=
""
local
color
=
"#FFFFFF"
-- don't trust any values in attributes, they might not be present
if
item
.
type
==
"bones"
then
-- bone
description
=
minetest
.
formspec_escape
((
item
.
attributes
.
info
or
"?"
)
..
" items: "
..
(
item
.
attributes
.
item_count
or
"?"
))
description
=
minetest
.
formspec_escape
(
(
item
.
attributes
.
info
or
"?"
)
..
" items: "
..
(
item
.
attributes
.
item_count
or
"?"
)
)
elseif
item
.
type
==
"shop"
then
-- shop
description
=
minetest
.
formspec_escape
(
"Shop, trading "
..
item
.
attributes
.
out_count
..
"x "
..
item
.
attributes
.
out_item
..
" for "
..
item
.
attributes
.
in_count
..
"x "
..
item
.
attributes
.
in_item
..
" Stock: "
..
item
.
attributes
.
stock
)
description
=
minetest
.
formspec_escape
(
"Shop, "
..
"trading "
..
(
item
.
attributes
.
out_count
or
"?"
)
..
"x "
..
(
item
.
attributes
.
out_item
or
"?"
)
..
" for "
..
(
item
.
attributes
.
in_count
or
"?"
)
..
"x "
..
(
item
.
attributes
.
in_item
or
"?"
)
..
" Stock: "
..
(
item
.
attributes
.
stock
or
"?"
)
)
if
item
.
attributes
.
stock
==
"0"
then
color
=
"#FF0000"
...
...
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