Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyCommandCenter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Starcraft AI Course
PyCommandCenter
Commits
7d6a28f0
"git@gitlab.liu.se:marta873/tddd27_2024.git" did not exist on "1e137522f7f7ad1f947b3dd6f60db16c496bc121"
Commit
7d6a28f0
authored
6 years ago
by
David Bergström
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug where returning reference to {} would crash
parent
bae085dd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/TechTreeImproved.cpp
+1
-1
1 addition, 1 deletion
src/TechTreeImproved.cpp
src/TechTreeImproved.h
+3
-0
3 additions, 0 deletions
src/TechTreeImproved.h
with
4 additions
and
1 deletion
src/TechTreeImproved.cpp
+
1
−
1
View file @
7d6a28f0
...
@@ -119,6 +119,6 @@ const std::vector<BuildDescription> & TechTreeImproved::HowToBuild(sc2::UnitType
...
@@ -119,6 +119,6 @@ const std::vector<BuildDescription> & TechTreeImproved::HowToBuild(sc2::UnitType
else
else
{
{
std
::
cout
<<
"No information about unit type "
<<
sc2
::
UnitTypeToName
(
unit
)
<<
" ("
<<
static_cast
<
int
>
(
unit
)
<<
")"
<<
std
::
endl
;
std
::
cout
<<
"No information about unit type "
<<
sc2
::
UnitTypeToName
(
unit
)
<<
" ("
<<
static_cast
<
int
>
(
unit
)
<<
")"
<<
std
::
endl
;
return
{}
;
return
empty
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/TechTreeImproved.h
+
3
−
0
View file @
7d6a28f0
...
@@ -25,6 +25,9 @@ class TechTreeImproved
...
@@ -25,6 +25,9 @@ class TechTreeImproved
std
::
map
<
sc2
::
UNIT_TYPEID
,
std
::
vector
<
BuildDescription
>>
producer_to_data
;
std
::
map
<
sc2
::
UNIT_TYPEID
,
std
::
vector
<
BuildDescription
>>
producer_to_data
;
std
::
map
<
sc2
::
UNIT_TYPEID
,
std
::
vector
<
BuildDescription
>>
result_to_data
;
std
::
map
<
sc2
::
UNIT_TYPEID
,
std
::
vector
<
BuildDescription
>>
result_to_data
;
// If there is no BuildDescription for a given type, a reference to tihs list is returned.
const
std
::
vector
<
BuildDescription
>
empty
{};
void
parse_unit
(
nlohmann
::
json
::
iterator
it
);
void
parse_unit
(
nlohmann
::
json
::
iterator
it
);
public
:
public
:
TechTreeImproved
();
TechTreeImproved
();
...
...
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