MCPcopy Create free account
hub / github.com/Norbyte/ositools / SetGuidString

Method SetGuidString

OsiInterface/Functions/FunctionUtilities.cpp:242–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240 }
241
242 void ShootProjectileApiHelper::SetGuidString(char const * prop, char const * value)
243 {
244 auto obj = FindGameObjectByNameGuid(value);
245
246 if (obj == nullptr) {
247 OsiError("GUID '" << value << "' is not a valid item or object");
248 return;
249 }
250
251 ObjectHandle handle;
252 obj->GetObjectHandle(&handle);
253 glm::vec3 position = obj->WorldPos;
254
255 if (strcmp(prop, "SourcePosition") == 0) {
256 Helper.StartPosition = position;
257 HasStartPosition = true;
258 }
259 else if (strcmp(prop, "TargetPosition") == 0) {
260 Helper.EndPosition = position;
261 HasEndPosition = true;
262 }
263 else if (strcmp(prop, "Source") == 0) {
264 if (obj != nullptr) {
265 Helper.SourceCharacter = handle;
266 }
267 }
268 else if (strcmp(prop, "Target") == 0) {
269 Helper.Target = handle;
270 }
271 else if (strcmp(prop, "Target2") == 0) {
272 Helper.Target2 = handle;
273 }
274 else {
275 OsiError("Unknown object property '" << prop << "'");
276 }
277 }
278
279 void ShootProjectileApiHelper::SetVector(char const * prop, glm::vec3 const & value)
280 {

Callers 1

ProjectileSetGuidStringFunction · 0.80

Calls 1

FindGameObjectByNameGuidFunction · 0.85

Tested by

no test coverage detected