aboutsummaryrefslogtreecommitdiff
path: root/src/cancel.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-10-25 15:11:04 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-10-25 15:11:04 +0200
commitf2d578555bf51da7a0acd1d1d7e724860b89a149 (patch)
treec0d34f1846bf6a57e42908485aeb00a1920b211b /src/cancel.cpp
parentb4bf1ad095452aabb12896040b522bf1746065a2 (diff)
downloadlanes-f2d578555bf51da7a0acd1d1d7e724860b89a149.tar.gz
lanes-f2d578555bf51da7a0acd1d1d7e724860b89a149.tar.bz2
lanes-f2d578555bf51da7a0acd1d1d7e724860b89a149.zip
Fix a minor assert message + code boyscouting
Diffstat (limited to 'src/cancel.cpp')
-rw-r--r--src/cancel.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp
index 2d0b807..46ed347 100644
--- a/src/cancel.cpp
+++ b/src/cancel.cpp
@@ -52,7 +52,7 @@ THE SOFTWARE.
52 */ 52 */
53[[nodiscard]] CancelRequest CheckCancelRequest(lua_State* const L_) 53[[nodiscard]] CancelRequest CheckCancelRequest(lua_State* const L_)
54{ 54{
55 Lane* const _lane{ kLanePointerRegKey.readLightUserDataValue<Lane>(L_) }; 55 auto const* const _lane{ kLanePointerRegKey.readLightUserDataValue<Lane>(L_) };
56 // 'lane' is nullptr for the original main state (and no-one can cancel that) 56 // 'lane' is nullptr for the original main state (and no-one can cancel that)
57 return _lane ? _lane->cancelRequest : CancelRequest::None; 57 return _lane ? _lane->cancelRequest : CancelRequest::None;
58} 58}
@@ -82,7 +82,7 @@ THE SOFTWARE.
82 82
83CancelOp WhichCancelOp(std::string_view const& opString_) 83CancelOp WhichCancelOp(std::string_view const& opString_)
84{ 84{
85 CancelOp _op{ CancelOp::Invalid }; 85 auto _op{ CancelOp::Invalid };
86 if (opString_ == "hard") { 86 if (opString_ == "hard") {
87 _op = CancelOp::Hard; 87 _op = CancelOp::Hard;
88 } else if (opString_ == "soft") { 88 } else if (opString_ == "soft") {
@@ -110,7 +110,7 @@ CancelOp WhichCancelOp(std::string_view const& opString_)
110 CancelOp _op{ WhichCancelOp(_str) }; 110 CancelOp _op{ WhichCancelOp(_str) };
111 lua_remove(L_, idx_); // argument is processed, remove it 111 lua_remove(L_, idx_); // argument is processed, remove it
112 if (_op == CancelOp::Invalid) { 112 if (_op == CancelOp::Invalid) {
113 raise_luaL_error(L_, "invalid hook option %s", _str); 113 raise_luaL_error(L_, "invalid hook option %s", _str.data());
114 } 114 }
115 return _op; 115 return _op;
116 } 116 }