added drop item function

This commit is contained in:
2025-05-04 19:18:55 -05:00
parent 63525b28ea
commit 1305481a35
2 changed files with 16 additions and 7 deletions
+14 -6
View File
@@ -1,16 +1,24 @@
use steamworks::{AppId, Client, SingleClient};
use steamworks::{
sys::{SteamAPI_ISteamInventory_TriggerItemDrop, SteamAPI_SteamInventory_v003},
AppId, Client, SingleClient,
};
#[allow(dead_code)]
pub struct Steam {
client: Client,
single: SingleClient
single: SingleClient,
}
impl Steam {
pub fn new() -> Self {
let (client, single) = Client::init_app(AppId(1430270)).unwrap();
Self {
client, single
Self { client, single }
}
pub fn drop_item(&self) {
unsafe {
let mut r = 0;
SteamAPI_ISteamInventory_TriggerItemDrop(SteamAPI_SteamInventory_v003(), &mut r, 1);
}
}
}
}