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

[WIP] Addressing vehicle's diagonal walls #26739

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f1e0904
declared sentinel_part struct
y2s82 Nov 17, 2018
1d7d7ac
implemented constructor, destructor, and placeholder to figure out ho…
y2s82 Nov 17, 2018
a9f753a
removed adjust_point in favor of passing in a point variable during t…
y2s82 Nov 17, 2018
fe73ab8
added bool sentinel_on that will indicate if the sentinel_part has be…
y2s82 Nov 17, 2018
6859c9f
added sentinel checking methods
y2s82 Nov 17, 2018
6dcf456
Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into is…
y2s82 Nov 18, 2018
0715f86
added threshold checks and set up for adding and removing sentinels
y2s82 Nov 18, 2018
07e4b74
Merge branch 'issue-5684-car' of github.com:y2s82/Cataclysm-DDA into …
y2s82 Nov 18, 2018
1e84317
removed an empty line added by a mistake
y2s82 Nov 18, 2018
302b04d
fixed a spelling error
y2s82 Nov 18, 2018
2e7b249
reverted unintended changes
y2s82 Nov 18, 2018
58505c5
Merge branch 'issue-5684-car' of github.com:y2s82/Cataclysm-DDA into …
y2s82 Nov 18, 2018
c6c0a6e
implemented the adding and removing on turn()
y2s82 Nov 18, 2018
18b638f
added change face.deg() to an absolute value before analysis
y2s82 Nov 18, 2018
8d23054
removed unneeded extra white line
y2s82 Nov 18, 2018
e5cf23d
formated using astyle
y2s82 Nov 19, 2018
fdccf8e
Merge branch 'master' of github.com:y2s82/Cataclysm-DDA into issue-56…
y2s82 Dec 1, 2018
25b92eb
added few simple changes
y2s82 Dec 1, 2018
e924a37
added new vectors for sidewalls and sentinels, and adjusted few logic…
y2s82 Dec 1, 2018
ebd8c99
applied astyle to fix styling
y2s82 Dec 3, 2018
2cd5138
adjusted vehicle_part constructors to account for the new sentinel de…
y2s82 Dec 3, 2018
b9bb374
modified mod_hp() to reflect sentinel interaction
y2s82 Dec 3, 2018
7e06cd1
applied astyle
y2s82 Dec 3, 2018
fbfcb26
better worded a comment
y2s82 Dec 3, 2018
8383afe
added clear() to sentinels,sidewalls. Also put some work into actuall…
y2s82 Dec 3, 2018
b2e694c
working on adding and getting index of a new sentinel
y2s82 Dec 3, 2018
51c22b7
implemented adding and removing of sentinel parts
y2s82 Dec 3, 2018
9f7d0c3
used astyle
y2s82 Dec 3, 2018
1d85b2e
removed unneeded function calls
y2s82 Dec 3, 2018
4b33b5b
added another check in case the original was removed while sentinel s…
y2s82 Dec 3, 2018
55919bf
removed sentinel_part code
y2s82 Dec 3, 2018
1e7aeee
modified code to change does_it_have_sentinel boolean to reflect the …
y2s82 Dec 3, 2018
416c682
updated more boolean and updated how refresh identifies sidewalls and…
y2s82 Dec 3, 2018
ae368c2
improved methods to find sidewalls
y2s82 Dec 3, 2018
3beb06e
corrected direction of the check when setting sentinel mount point
y2s82 Dec 3, 2018
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
10 changes: 10 additions & 0 deletions src/vehicle.cpp
Expand Up @@ -4814,3 +4814,13 @@ bool vehicle_part_with_feature_range<vpart_bitflags>::matches( const size_t part
( !( part_status_flag::available & required_ ) || vp.is_available() ) &&
( !( part_status_flag::enabled & required_ ) || vp.enabled );
}

sentinel_part::sentinel_part(vehicle_part* org,point p) : vehicle_part(*org)
{
this->original=org;
mount=p;
}
sentinel_part::~sentinel_part(){
mount=original->mount;
*original = (vehicle_part)*this;
}
16 changes: 16 additions & 0 deletions src/vehicle.h
Expand Up @@ -375,8 +375,10 @@ struct vehicle_part {
* this part.
*/
item_group::ItemList pieces_for_broken_part() const;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add unnecessary whitespace.

};


class turret_data
{
friend vehicle;
Expand Down Expand Up @@ -1525,4 +1527,18 @@ class vehicle
mutable point mass_center_no_precalc;
};

/**
* Sentinel Parts that is used to block diagnal openings created when vehicles are at an angle.
* The sentinel_part serves as a special type of vehicle_part with a specific purpose of being used only to block passage 'through' the walls of the vehicle.
* It is designed to be dynamically created on a vehicle_part*, with the constructor copying over the value from the original, and removed when nolonger needed with the constructor who also takes care of the transfer of datasets.
*/
struct sentinel_part : public vehicle_part
{
private:
vehicle_part* original;
public:
sentinel_part()=delete;
sentinel_part(vehicle_part* org,point p);
~sentinel_part();
};
#endif