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

CS2 no GrenadeProjectile.Velocity() #408

Open
ZgredFred2 opened this issue Sep 1, 2023 · 1 comment
Open

CS2 no GrenadeProjectile.Velocity() #408

ZgredFred2 opened this issue Sep 1, 2023 · 1 comment

Comments

@ZgredFred2
Copy link

Describe the bug
Using e.Projectile.Velocity() with cs2 demo gives error with
failed to parse demo: property 'm_vecVelocity' not found

To Reproduce
Parse provided demo file with code below

Code:

package main

import (
	"fmt"
	"log"
	"os"

	dem "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs"
	events "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/events"
)

func main() {
	f, err := os.Open("./trash_left.dem")
	if err != nil {
		log.Panic("failed to open demo file: ", err)
	}
	defer f.Close()

	p := dem.NewParser(f)
	defer p.Close()

	p.RegisterEventHandler(func(e events.GrenadeProjectileBounce) {
		fmt.Printf("%s\n", e.Projectile.Velocity())
	})

	err = p.ParseToEnd()
	if err != nil {
		log.Panic("failed to parse demo: ", err)
	}
}

Expected behavior
Prints projectile velocity or do not be able to call .Velocity()

Library version
v4.0.0-beta.0

Additional context
Works with CSGO demos.
Demo recorded 01.09.2023 with tv_enable 1 and tv_record fileName.
trash_left.zip
console out.txt

@markus-wa
Copy link
Owner

I haven't found the velocity field for entities yet - if anyone knows where to get that data, please let me know 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants